iOS-UIViewController

来源:互联网 发布:java d3.js 编辑:程序博客网 时间:2024/04/30 05:28

//带导航条的

- (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;

}




原创粉丝点击