Adding iOS 7 version of iPhone 4-inch launch image to project breaks launch image when run on iOS 7

后端 未结 3 1475
慢半拍i
慢半拍i 2020-12-31 23:23

I\'m running into a problem on our landscape only app that targets iOS 6 and 7. Xcode gives me the following warning:

An iPhone Retina (4-inch) launc

相关标签:
3条回答
  • 2020-12-31 23:37

    XCode is looking for Portrait orientation for iPhone. You need to provide it for the launch image, but don’t let your application to rotate when device is in Portrait mode.
    In order to do this you need to do the following:

    • Go to General -> Deployment Info -> Device Orientation. Deselect Landscape Left and Landscape Right. Select Portrait, then Landscape Left and Landscape Right, order is important!
    • Add the following function to your code (if not yet):

    -(NSUInteger)supportedInterfaceOrientations { return (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight); }

    That’s all!

    0 讨论(0)
  • 2020-12-31 23:49

    In my case (landscape only app), I was able to fix it by doing the following:

    • adding portrait to the supported orientations for the iPhone in my Info.plist

    • replacing shouldAutorotate: methods with supportedInterfaceOrientations and preferredInterfaceOrientationForPresentation in my view controllers.

    • added application:supportedInterfaceOrientationsForWindow: to my app delegate.

    Also I had to make sure that in the Info.plist that the portrait orientation was listed first. Xcode had added it to the end of the list, but if it was there, it would still be a black display on launch. Moved to the top, it was properly detected by iOS when the app was launching.

    0 讨论(0)
  • 2021-01-01 00:03

    LaunchImage import a 640*1136 picture,

    BTW, LaunchImage in Images.xcassets

    sample picture

    0 讨论(0)
提交回复
热议问题