Setup different launch screen interface on ipad/iphone

前端 未结 4 746
猫巷女王i
猫巷女王i 2020-12-31 11:07

I am trying to setup different launch-screen .xib file in my iPhone application.

I want to know is there any way I can setup different launch screen fil

相关标签:
4条回答
  • 2020-12-31 11:13

    I created two storyboard files for example: LaunchScreen_iPhone.storyboard and LaunchScreen_iPad.storyboard. Doesn't have to be those exact names. The file names are referenced from the Info.plist file.

    In the Info.plist file edit the "Launch screen interface file base name" (UILaunchStoryboardName) key value to "LaunchScreen_iPhone"

    Create another key-value entry in the Info.plist in the key name "UILaunchStoryboardName~ipad" and value "LaunchScreen_iPad"

    0 讨论(0)
  • 2020-12-31 11:14

    You can also use storyboard based Launchscreen and make device dependent layout in one file.

    Layout your launchscreen for iphone with size classes (w: Any, h: Any), then change size classes to w: Regular, h: Regular and layout it again for iPad by uninstalling conflicting views/constraints and installing new.

    You can read more about adaptive layout here: https://www.raywenderlich.com/113768/adaptive-layout-tutorial-in-ios-9-getting-started

    I believe this is recommended approach since Apple introduced features like Split View. That way you can launch your app on iPad but with screen size of iPhone.

    0 讨论(0)
  • 2020-12-31 11:19

    In the Info.plist file, create another entry called UILaunchStoryboardName~ipad and set it to your LaunchScreeniPad.xib

    0 讨论(0)
  • 2020-12-31 11:34

    Create two .xib files named

    LaunchScreen2~iphone.xib

    LaunchScreen2~ipad.xib

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