iOS自定义初始化Window

时间:2016-05-30 00:49:21   收藏:0   阅读:1409

新建工程后删除viewController.h和viewController.m main.storyboard

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

    //创建窗口

    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];//初始化Window

    UITabBarController * tabBarVc = [[UITabBarController alloc]init];

    self.window.rootViewController = tabBarVc;//设置根视图控制器

    //显示窗口

    [self.window makeKeyAndVisible];

    return YES;

}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!