為iPad和iPhone程序增加啟動畫面非常簡單,基本思路就是增加啟動圖片資源Default.png即可,只是要根據不同的分辨率和旋轉方向需要有不同的圖片尺寸。
目前的iOS設備主要有四種不同的分辨率:
1 iPad 768×1024
2 New Pad 1536×2048
3 iPhone4 640×960
4 iPhone 320×480
如果一個程序,既要支持iPad又要支持iPhone,那么它需要包含下面幾個圖片:
1 Default.png iPhone默認啟動圖片,如果沒有提供上面幾個iPad專用啟動圖片,則在iPad上運行時也使用Default.png(不推薦) 320×480或者320×460
2 Default@2x.png iPhone4啟動圖片640×960或者640×920
3 Default-Portrait.png iPad專用豎向啟動畫面 768×1024或者768×1004; 對應的ipad3 為Default-Portrait@2x.png 1536×2048
4 Default-Landscape.png iPad專用橫向啟動畫面 1024×768或者1024×748; 對應的ipad3 為Default-Landscape@2x.png 1536×2048
5 Default-PortraitUpsideDown.png iPad專用豎向啟動畫面(Home按鈕在屏幕上面),可省略 768×1024或者768×1004; 對應的ipad3 為Default-PortraitUpsideDown@2x.png 1536×2048
6 Default-LandscapeLeft.png iPad專用橫向啟動畫面(可省略), 1024×768或者1024×748;對應的ipad3 為Default-LandscapeLeft@2x.png 1536×2048
7 Default-LandscapeRight.png iPad專用橫向啟動畫面(可省略), 1024×768或者1024×748;對應的ipad3 為Default-LandscapeRight@2x.png 1536×2048
為了在iPad上使用上述的啟動畫面,你還需要在xxxx_info.plist中加入key(根據下拉菜單中的可選項選擇):
1 UISupportedInterfaceOrientations
2 或 Supported interface orientations
同時,為其加入值(根據下拉菜單中的可選項選擇):
1 UIInterfaceOrientationPortrait 或 Portrait (bottom home button)
2 UIInterfacOrientationPortraitUpsideDown 或 Portrait (top home button)
3 UIInterfaceOrientationLandscapeLeft 或 Landscape (left home button)
4 UIInterfaceOrientationLandscapeRight 或 Landscape (right home button)
by gqzhu
