Quantcast
Viewing all articles
Browse latest Browse all 80

iOS9 APP 上下黑邊(iOS9 App has black bars on top and bottom)

iOS9 APP 上下黑邊(iOS9 App has black bars on top and bottom)

當你的轉案是從Xcode 5、Xcode 6一路升級上來時,在新版的Xcode編譯專案並下載至手機或模擬器時卻發生App上下有黑邊,也就是App被置中而不是像之前的置頂:

Image may be NSFW.
Clik here to view.

此時您檢查一下設定,是不是未指定Launch Screen File,在Xcode會檢查您是否有Launch Screen File來判斷你的App設定是否為舊解析度(3:2)的App,未設定會依照(3:2)的解析度與大小顯示,加上iOS 9的關系會將App置中:

Image may be NSFW.
Clik here to view.

所以新增建立Launch Screen

Image may be NSFW.
Clik here to view.

選擇Launch Screen

Image may be NSFW.
Clik here to view.

建立好預設之後,到General->App Icons and Launch Images將Launch Screen File指定成你新建立的檔案,如下圖:

Image may be NSFW.
Clik here to view.

重新編譯並下載至模擬器或實機就不會有上下黑邊,但你的佈局如果不是用Auto Layout與Size Classes時,您的佈局畫面與螢幕大小不符合時,多於的空間就會顯示白邊或黑邊像這樣:

Image may be NSFW.
Clik here to view.

所以不管如何,舊專案建議還是啟動Auto LayoutSize Classes

參考資料

iOS9 App has black bars on top and bottom

iOS 9 status bar appears below black bar


Viewing all articles
Browse latest Browse all 80

Trending Articles