3
votes

My application supports both orientation landscape and portrait and here i am using launch screen for splash screen then dragged uiimageview and pined trail, lead, bottom, top...what are all the sizes required to add? should i use image assets? Do i have to create two different image? I am using two different image for iPhone and iPad by using size class, Its stretching when iPad runs on landscape mode.

I am referring this https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/

Here how to set image for landscape and portrait and sizes?

We know how to use launch image using asset catalog.

For iPhoneX design gets collapsed, many people suggested us to use launch screen storyboard, then iPhoneX issue went away..

Thanks in advance...

2
Reference link (added by you) show dimensions for static launch images. You may not need launch screen if you add static launch image.Krunal
see my updated questionkarthikeyan

2 Answers

1
votes

Here is good Apple document answering your question: Launching your iPhone Application in Landscape

Very concise, this document says
Set launch image for either Portrait mode or Landscape mode. Choose orientation of launch image according to your requirement for Application Launch. Do not use static launch image, if your application supports both orientation.


Launch Images
Launch images for iPhone apps are always sized to match the dimensions of the screen in portrait orientation. For applications that launch into landscape orientation, you should use your preferred graphics editing software to rotate the content of the launch image while keeping the image's size consistent with a portrait launch image (height > width).

Avoid using asset catalogs to manage the launch images of landscape applications.
Except for launch images used by the iPhone 6 Plus, asset catalogs assume that all iPhone launch images are for the portrait orientation. When your application is compiled, entries for each launch image are added to the compiled information property list under the UILaunchImages key. The value for the UILaunchImageOrientation key in each of these entries is always Portrait. These entries are then ignored at launch time because the value of Portrait for the UILaunchImageOrientation key does not match the launch orientation (Landscape Left or Landscape Right). The result is a blank screen during launch as the system cannot find an appropriate launch image.

Instead, you should use a Launch File if your application only supports iOS 8 and above. Otherwise, you will need to add your launch images as resources to your project and then add the UILaunchImages key to your application's information property list. Be sure to disable use of the asset catalog for managing the launch images by selecting 'Don't use asset catalogs' from the Launch Image Source menu under the General tab of the project editor for your applications' target.

It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary. Create static images in different sizes for different devices, and be sure to include the status bar region.

Static Launch Screen Images

Here is dimension table for static launch screen image for both orientations:

enter image description here

How to set landscape static image?

Enable Landscape launch screen image support from your image assets

(Image) Assets.xcassets >> Launch Image >> Attribute Inspector >> Enable Landscape (tickmark) >> Set Landscape images

enter image description here

Here is nice tutorial for the same: Customizing LaunchScreen.storyboard

0
votes

Set image with size of 1125 × 2436 for iPhone X.