我升级到ios 9和xcode 7(来自xcode 6.2),现在当我启动应用程序时会发生这种情况:
现在上面和下面都有这些黑条。
我的appDelegate是这样的:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
// self.window.backgroundColor = [UIColor whiteColor];
// [self.window makeKeyAndVisible];
_startViewController = [[StartViewController alloc] init];
_startNavigationController = [[StartNavigationController alloc] initWithRootViewController:_startViewController];
self.window.rootViewController = _startNavigationController;
[self.window makeKeyAndVisible];
// Need to fix this since deprecated
// [application prefersStatusBarHidden:NO];
// [application preferredS :UIStatusBarStyleDefault];
// [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
return YES;
}
答案 0 :(得分:5)
案例在应用程序图标和启动图像下的常规设置中缺少 LaunchScreen.storyboard :
以上功能不起作用请检查以下步骤:
答案 1 :(得分:3)
First of all please add these images at your Images.xcassets directory. You can also change these images but be careful to keep sizes and titles :)
Name them with their titles. Default.png
Default-Portrait-736h@3x.png
Default-667h@2x.png
Default-568h.png
Then select LaunchImage at General : App Icons and Launch Images : Launch Images Source
答案 2 :(得分:1)
检查项目是否有LaunchScreen.storyboard
个文件。没有这个Xcode就会对你的屏幕尺寸做出假设。创建一个LaunchScreen.storyboard
文件并将其添加到您的项目中。
答案 3 :(得分:0)
如果您不想添加任何启动画面,如果它不能用于任何目的,例如它是白色或黑色,那么您只需添加launchScreen.xib并选择它启动屏幕文件选项目标设置。