一,去掉Main.storyboard和LaunchScreen.storyboard
为啥要去掉这个呢,因为项目需要在启动图做点文章,要动态的,还有,为了以后维护,项目一直是不使用这个storyboard,小伙伴们不要喷我哈。
去掉这个后,需要做点东西,不然运行会崩的。需要2点设置
1,Main interface和Launch Screen File里面的东西要去掉,就是启动时不要使用storyboard启动。
![](https://img.haomeiwen.com/i182647/ef3d6bdbffb8f4cf.png)
![](https://img.haomeiwen.com/i182647/2b93145e740e1045.png)
2,在Appdelegate里添加如下代码,设置一下rootViewController。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
ViewController *vc = [[ViewController alloc]init];
self.window.rootViewController = vc;
[self.window makeKeyAndVisible];
return YES;
}
二,再次运行一下,你会发现,怎么这个这个样子了呢·,听我慢慢道来
![](https://img.haomeiwen.com/i182647/01af9519d781b99c.png)
其实,也不必大惊小怪,这是Xcode6以后带来的一个坑,如何设置呢,
![](https://img.haomeiwen.com/i182647/21738c550fe882b0.png)
1.选中工程文件。
2.找到App Icons and Launch Images,点击Use Asset Catalog。一定要设置一下启动的图片
3.在弹出的界面上选择Migrate即可。
4.设置一下Launch Images。
网友评论