Xcode删除项目默认的storyboard

2019-03-14  本文已影响0人  jasperWhf

新建项目后,希望把默认的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后出现的上下黑边问题

上一篇 下一篇

猜你喜欢

热点阅读