Load Different Launch Screen for iPad / iPhone

前端 未结 2 1937
没有蜡笔的小新
没有蜡笔的小新 2021-02-07 15:24

i want to load different launch screen storyboard for iPad and iPhone & for that i add new entry in info.plist like below

but it load only iPhone launch scr

相关标签:
2条回答
  • 2021-02-07 15:53

    You can use a single Storyboard to load different Launch images for iPad and iPhone. In your LaunchScreen.storyboard, go to the Attributes Inspector of the ImageView where you set the image. Set launch image for iPhone in Image field. There is a plus sign near the "Image" field. Click on it and change the Height from Compact to Regular and click Add Variation. Another field is created as wR hR. Add the launch image for iPad there. Thats it. Now it loads launch image based on your device.

    0 讨论(0)
  • 2021-02-07 15:54

    Way 1: You have to use two xib's for this. One for iPad and the other one for iPhone. You have to name it as follows,

    iPhone- LaunchScreen2~iphone.xib

    iPad - LaunchScreen2~ipad.xib

    or

    Way2: Open your Info.plist file. Create another entry as UILaunchStoryboardName~ipad and set it to your LaunchScreeniPad.xib.

    Revert back in case if you face any difficulties

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