本文共 716 字,大约阅读时间需要 2 分钟。
1.注掉info.plist中的下面部分
<!-- <key>UILaunchStoryboardName</key>-->
<!-- <string>LaunchScreen</string>-->
<!-- <key>UIMainStoryboardFile</key>-->
<!-- <string>Main</string>-->
2.添加如下代码
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootVC = [[UIViewController alloc] init]; rootVC.view.backgroundColor = [UIColor blueColor]; self.window.rootViewController = rootVC; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; //以下为自定义代码,上面的六行代码为适配代码 NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"View" owner:self options:nil]; [self.window addSubview:[views lastObject]];
转载地址:http://fqrwn.baihongyu.com/