美文网首页
用Xcode7搭建工程基础框架

用Xcode7搭建工程基础框架

作者: QuZhengPing | 来源:发表于2017-06-13 20:59 被阅读6次

一,去掉Main.storyboard和LaunchScreen.storyboard

为啥要去掉这个呢,因为项目需要在启动图做点文章,要动态的,还有,为了以后维护,项目一直是不使用这个storyboard,小伙伴们不要喷我哈。

去掉这个后,需要做点东西,不然运行会崩的。需要2点设置

1,Main interface和Launch Screen File里面的东西要去掉,就是启动时不要使用storyboard启动。

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;

}

二,再次运行一下,你会发现,怎么这个这个样子了呢·,听我慢慢道来

其实,也不必大惊小怪,这是Xcode6以后带来的一个坑,如何设置呢,

1.选中工程文件。

2.找到App Icons and Launch Images,点击Use Asset Catalog。一定要设置一下启动的图片

3.在弹出的界面上选择Migrate即可。

4.设置一下Launch Images。

相关文章

网友评论

      本文标题:用Xcode7搭建工程基础框架

      本文链接:https://www.haomeiwen.com/subject/nvfnsttx.html