Source Address: http://blog.shiqichan.com/Launch-Screen-in-iOS-7-and-8/
The issues to be addressed in the current project are:
- Compatible with IOS7 and iOS8, previous versions do not require support for
- Implementation compatible with 3.5, 4, 4.7 and 5.5 inch screens, vertical screen lauch screen
Create the PNG picture you want
For iphone6/6+ related dimensions see here
The following size images are required:
- 1242x2208 for iphone6+, or 1080x1920, or retina HD 5.5
- 750x1334 for IPhone6, retina HD 4.7
- 640x1136 for 4-inch screen (iphone5/5s), Retina 4
- For a 3.5 inch (iphone4/4s) 640x960, it is 2x
Using Launchimage
With Launchimage, iOS7 and iOS8 are compatible.
Because IOS8 will also be called LaunchScreen.xib
, so my practice is to delete it directly. This is the file:
Then, in the Images.xcassets
create aLaunchImage
Required in the project properties, launch Images Source
set toLaunchImage
Tested a bit:
- iphone6+ is using Retina HD 5.5.
- IPhone6 is using Retina HD 4.7.
- IPhone5S is using Retina 4.
- Iphone4s is using 2x.
Using Lauchscreen.xib
This is the new function of Xcode6/ios8, that is, this step is to support iOS8, and not support iOS7. In fact, in the current project is not used, but did the technical preparation, write down it.
See this square xib file, strange, this is to support horizontal screen and vertical screen, because this project only need vertical screen, also can this:
It doesn't matter if you don't change.
Images.xcassets
Create inbackgroundImage
LaunchScreen.xib
add a picture to the, with just created backgroundImage
.
Test it, iOS8 below the launch screen is no problem:
- iphone6+ is 3x.
- IPhone5S is Retina 4 2x.
- Both IPhone6 and iphone4s are used in 2x.
So I did not add 1x pictures, basically useless.
Conclusion
- At present the better way is to use
Launch Image
the way to create picture files of various devices, compatible with IOS7/8
- Use
LaunchScreen.xib
, more powerful, but only support iOS8, maybe a few years can become the mainstream method
Source code See here: GitHub, is LaunchImage
the way to use.
IOS 8: "Turn" implementation of Launch screen in IOS7/8