新建项目后,希望把默认的Main.storyboard和LaunchScreen.storyboard删除,删除后上下出现黑边。
删除Main.storyboard和LaunchScreen.storyboard
1.png
删除后改下这两个地方(改为空)
2.png
AppDelegate.m (记得根视图要设置颜色,否则还是黑色)
#import"AppDelegate.h"#import"ViewController.h"@interfaceAppDelegate()@end@implementationAppDelegate- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {self.window = [[UIWindowalloc] initWithFrame:[UIScreenmainScreen].bounds];self.window.rootViewController = [[ViewController alloc] init]; [self.window makeKeyAndVisible];returnYES;}
然后运行发现上下黑边
在info.plist中设置
在运行程序
4.png
OK搞定了,解决了删除Main.storyboard和LaunchScreen.storyboard后出现的上下黑边问题
网友评论