ios啟動畫面設置---launch Images(三步搞定)


UILaunchImageFile (String - iPhone OS) specifies the name of the launch image file for the application. If this key is not specified, the system assumes a name of Default.png. This key is typically used by universal applications when different sets of launch images are needed for iPad versus iPhone or iPod touch devices.

If you include this key in your Info.plist file, any launch images you include in your application’s bundle should be based on the string. For example, suppose you want to include portrait and landscape launch images for iPad using the base name MyiPadImage.png. You would include the UILaunchImageFile~ipad key in your Info.plist file and set its value to MyiPadImage.png. You would then include a MyiPadImage-Portrait.png file and a MyiPadImage-Landscape.png file in your bundle to specify the corresponding launch images. 

 

意思很明顯,(1)准備橫屏和豎屏的啟動畫面的文件(如果只有豎屏,則准備豎屏的圖片,如果只有橫屏,則只需要准備橫屏的圖片,如果支持橫豎屏切換,就准備兩張吧,如果只支持橫豎屏其中一種,記得在target->Summary->Supported Device Orientations 中選中支持的設備方向),如果你的info.plist沒有配置LaunchImge,(2)就將橫屏和豎屏的圖片命名為Default-Landscape.png和Default-Portrait.png, (3)放到資源目錄,添加到工程中,然后你就可以在target->Summary->Launch Images中看到啦,接下里clean工程跑下就沒問題了。

如果你想把啟動畫面的那張圖片做別的用處或者不想用Default-Landscape.png和Default-Portrait.png名字,可以配置info.plist(我的xcode是4.2的),修改或者添加Launch Image,然后設置值為XXX.png,添加橫屏和豎屏的圖片命名為XXX-Landscape.png和XXX-Portrait.png,添加到資源目錄和工程,就可以啦。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM