2015-10-06 87 views
2

我升級到iOS 9和Xcode的7(在Xcode 6.2),現在發生這種情況時,我開始我的應用程序:IOS 9 Objective-C的屏幕尺寸問題

enter image description here

現在有這一切的黑網吧上面和下面。

我的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

看起來你錯過了正確的啓動屏幕大小。您應該使用圖片資源並填寫所有需要的大小。 – rckoenes

+0

您是否將所有啓動畫面與正確的尺寸進行了整合?如果不是,那麼請做。 – pkc456

+0

這是怎麼完成的? – cdub

回答

5

案件正在應用圖標丟失LaunchScreen.storyboard一般設置和啓動圖像:

enter image description here

上述功能無法正常工作按照以下步驟檢查:

  1. 導航至項目設置
  2. 在「應用程序圖標和啓動圖像」下單擊「使用資產目錄」
  3. 在出現的彈出窗口中選擇「遷移」。

這應該解決這個問題。

enter image description here

+0

我沒有在我的iOS 7應用程序中設置啓動圖像。我想現在對ios 9來說是強制性的? – cdub

+0

是的,這是強制性的。請設置正確尺寸的啓動圖像。如果沒有這個,Xcode會對你的屏幕尺寸做一個假設。 – pkc456

+0

哦有趣。謝謝,我現在就爲此努力。 – cdub

1

檢查項目,如果它有LaunchScreen.storyboard文件。如果沒有這個,Xcode會對你的屏幕尺寸做一個假設。創建一個LaunchScreen.storyboard文件並將其添加到您的項目。

3

首先請將這些圖像添加到Images.xcassets目錄中。 您也可以更改這些圖像,但要小心保持大小和標題:)

將它們的名稱命名。 爲Default.png

Default.png

[email protected]

Default-Portrait-736h@3x.png

[email protected]

Default-667h@2x.png

默認-568h.png

Default-568h.png

然後選擇LaunchImage在通用:應用程序圖標和啓動圖像:啓動圖片來源

0

如果你不想添加任何閃屏如果它在這種情況下不起任何作用,例如它是白色或黑色,則可以簡單地添加launchScreen.xib並選擇它啓動屏幕文件選項目標設置。