问题
using xcode 7 I wanna to create a Launch Screen with the same image for all iPhones.
In the application main target -> General -> App Icones and Launch Images -> Launch Image Source I have selected the "LaunchImage"
In the assets I created a LaunchImage (App Icons & Launch Images->New iOS Launch Image) and I put all the images applicable to the various devices.
When I start my app there isn't launch image. Anyone know why? Thanks to all
回答1:
As i mentioned in the comment remove the Launch screen file
value from the Launch(application main target) -> General -> App Icons and Launch Images -> Launch screen file, so it will be likes this
After that you run it, it should be there
回答2:
I solved it with this code:
extension UIImage {
convenience init?(fullscreenNamed name: String) {
switch UIScreen.mainScreen().bounds.size.height {
case 480: //iPhone 4/4s
self.init(named: "\(name)-700@2x.png")
case 568: //iPhone 5/5s
self.init(named: "\(name)-700-568h@2x.png")
case 667: //iPhone 6/6s
self.init(named: "\(name)-800-667h@2x.png")
case 736: //iPhone 6+/6s+
self.init(named: "\(name)-800-Portrait-736h@3x.png")
default:
self.init(named: name)
}
}
}
I take in "LaunchImage" the right image for the device screen in use.
@Pyro, thanks for your help
来源:https://stackoverflow.com/questions/36581320/use-launch-image-for-launch-screen