How to set the startup screen in ios7,8


   In ios8 under , apple for the startup interface made significant adjustments , added a xib file (LaunchScreen.xib) as the start of the application program interface. The document only ios8 effective after the system. If the application only supports ios8 after the system , so long as the interface is set to start by the xib file settings on it.

   In ios7 under , set the app 's interface is started by setting a static picture , apple asked to prepare a different picture sizes for the different screen sizes of mobile phone. When the program starts , the system will automatically load the corresponding start the picture depending on the size of the current mobile phone screen as the start screen. Start unified picture on images.xcassets folder below LaunchImage inside.

    If the application supports ios7 and ios8 version , then set the startup screen should pay attention to:

    Two cases :

    First, do not use LaunchScreen.xib file (delete LaunchScreen.xib )

     1> will start adding pictures to images.xcassets folder below LaunchImage inside.

     2> must be provided in various sizes starting picture.

        * iphone4  retina 320 * 480 Default.png

        * iphone4s 640 * 960   [email protected]

        * iphone5,5s,5c  640 * 1136  [email protected]

        * iphone6 750 * 1334   [email protected]

        * iphone6 1242 * 2208   [email protected]

 

     3> in iphone 6 under the system , if no iphone6 corresponding start picture , the system will automatically find other startup picture as the start picture. Find a way:

        * To see whether the iphone5,5s, 5c corresponding start picture , there is brought to use. In this case app window size is 320 * 568 . Otherwise, keep looking.

        * To see whether the iphone4s corresponding start picture , there is the use of them , this time app window size is 320 * 480 . Otherwise, keep looking.

        * To see whether the iphone4 corresponding start picture , there is the use of them , this time app window size is 320 * 480 .

        * If it is not found available boot images , the system will use a size of 320 * 568 black picture as the start picture. At this time, the window size is 320 * 568 .

        * After the above search process , if a picture is starting for iphone4,4s of , then leaving a black area at the meeting of the entire screen. And if a picture is starting for iphone5,5c, 5s, it will not happen.

         The reason is : the application of the final size depends on the size of the boot interface. That is app final size depends on the size of the boot image size. iPhone5,5c, 5s screen aspect ratio of (320 * 568) and iphone6 screen aspect ratio of (375 * 667) as , the size of such application the system will be stretched to a size of the entire screen size. The iphone4,4s 's aspect ratio and iPhone6 screen height ratio is very different , if also by stretching, then , will inevitably lead to the phenomenon of deformation. So Apple is using the up and down to stay out of the way a black area to keep the original aspect ratio.

 

     4> In iphone 6 plus the system , if no iphone 6 plus the corresponding boot image.

* In previous versions of Xcode6.4, the system will not continue to look for , will automatically use a black full-screen picture as the start picture. ( Why did not provide iphone6 corresponding boot images , the system will look for other pictures , but iphone6 plus not ? Guess because iphone6 plus start-picture format is @ 3x, and @ 2x is not the same level )

* In later versions Xcode6.4, the system will automatically find other startup picture as the start picture. Find the same under way to find ways and iphone 6 system.


Precautions: In the case of LaunchScreen.xib delete files, folders if LaunchImage no picture below,

> Application running on a 4 / 4s phone, the app window size is 320 * 480.

> Application running on a 5 / 5c / 5s / 6 / 6p phone, the app window size is 320 * 568.


    Second, the use LaunchScreen.xib file

     1> when the application runs in ios8 when the system, only use LaunchScreen.xib file as the startup screen. Regardless of whether the corresponding picture start in images.xcassets folder below LaunchImage inside.

     2> in ios7 will still go images.xcassets folder below LaunchImage go inside to find the corresponding start picture.

Published 10 original articles · won praise 1 · views 5888

Guess you like

Origin blog.csdn.net/pkxwyf/article/details/43155995