很多开发人员用习惯了Xcode的空模板,但是iOS6以后Xcode上就没有了空模板,苹果刚发布的iOS9,我便把Xcode直接升级到了7,但是在创建空模板的时候遇到了一个问题,就是上下老是会出现间距
如图所示:

解决办法:
步骤一:删除默认创建的几个文件

步骤二:删除plist文件中标记的东西

步骤三:在AppDelegate里面添加三句话:
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [[UIViewController alloc]init];//这个是我们自己写上去得
[self.window makeKeyAndVisible];
如图所示:

步骤四:

步骤五:

步骤五:运行程序你会发现没有解决问题
如图所示:

步骤六:我们需要在Assets.xcassets中创建一个LaunchImage
如图所示:

步骤7:创建完了之后运行其实还是会发现仍然没有解决问题
然后最关键的地方就是,我们把LaunchImage里面所需要的图片放进去就ok了,大于等于一张就可以了。
纯属个人,如有不妥,还请见谅。
网友评论