iOS-UIViewController

林炫明
2023-12-01

//带导航条的

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

    // Override point for customization after application launch.

    self.window.backgroundColor = [UIColor whiteColor];

    MainViewController *col=[[MainViewController alloc] init];

    [self.window setRootViewController:col];

    [col release];

    [self.window makeKeyAndVisible];

    return YES;

}

2 不到导航条

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];

    // Override point for customization after application launch.

    self.window.backgroundColor = [UIColor whiteColor];

    MainViewController *col=[[MainViewController alloc] init];

    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:col];

    [self.window setRootViewController:nav];

    [col release];

    [nav release];

    [self.window makeKeyAndVisible];

    return YES;

}




 类似资料: