Launch Screen .XIB with full screen image view - ios

I have created LaunchScreen for my iOS app project which has an image view which is anchored to top, left, bottom and right edges of root view with 0 space.
Q1.What should be the resolution of the image for supporting all screen sizes for iPhone and iPad in landscape or portrait?
Q2.Should I be again providing images of different resolutions for different screen sizes and orientations for iPhone and iPad like LaunchImage asset?

Q1.What should be the resolution of the image for supporting all screen sizes for iPhone and iPad in landscape or portrait?
Regarding to #heximal
You can set "Scale to fill" mode for your image view and provide any image size (size of you xib, for example).
Q2.Should I be again providing images of different resolutions for different screen sizes and orientations for iPhone and iPad like LaunchImage asset?
Create new image set in assets and provide just 3 images for your launch screen -#1x #2x #3x

Refer:
Or visit below link for all image sizes:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW2

Related

Launch Screen Storyboard

As LaunchScreen I want to have an exact image of the start page that appears right after the launch.
Therefore, I made screenshots of all resolutions of the start page, both portrait and landscape. Then I removed all fonts because I generate two variants of the app in different languages and the texts (e.g. in the buttons) are different. The launch screens should fit both variants.
In Images.xcassets I added LaunchImage and assigned all positions with the correct resolutions (for both, iPhone and iPad).
LaunchScreen.storyboard has an ImageView in the ViewController with the image name LaunchImage.
Result:
1 All launch images displayed are scaled even though the correct resolutions are available.
Only the portrait images are used, also for landscape, and therefore scaled and distorted.
on iPads only iPhone images are displayed, portrait version also in landscape, scaled accordingly.
On some devices (e.g. iPhone X), only a white or black screen is displayed at launch (portrait and landscape).
Under no circumstances will the correct launch screen be displayed.
On the image you see all relevant areas and the list of all used launch images.
What did I do wrong or miss?
Supplement:
I just followed another tip and deactivated "Clears Graphic Context" in UIImageView and changed the display to "Aspect Fit".
Result: The portrait launch image is still used in the iPad, but is no longer scaled and is now centered.
So the most important question now is why an iPhone portrait launch image is used for iPad in both directions.
If you are using a LaunchImage, you should set that image in the Target settings. Go to your target and under the General tab, set the Launch Images Source value to the image you have in your asset catalog:
Also delete the text LaunchScreen in the Launch Screen File field.

Launch screen not working properly

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...
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:
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
Here is nice tutorial for the same: Customizing LaunchScreen.storyboard
Set image with size of 1125 × 2436 for iPhone X.

How do you set up 'image sets' to match launchImage files for all devices?

NOTE: This question is NOT related to launch image storyboards.
INFO: BG Buddy is a landscape only app. The launch screen uses images in a launchImage.xcassets file.
The launch image transitions to a UIViewController containing a full screen UIImageView with the same BG Buddy Background image as used in the launch image, and some textual UIButtons. This gives the impression that the buttons appear on top of the background image after a short time when the app has loaded.
Here is how the BG Buddy Background image set has been set up since the app’s release. Transitions from Launch Image to UIViewController work perfectly on iPad, iPhones 5,6,7,8 and 6,7,8 Plus.
The iPhone X and the iPhone Plus both seem to use the iPhone 3x image slot but both have very different dimensions. I’ve opened up the other size classes slots and tried to find a place with much confusion and no success. NOTE: All iPhones apart from the iPhone Plus use compact width/compact height size classes when in landscape. The iPhone Plus uses regular width/ compact height in landscape orientation.
So how do you set up 'image set' files to match launchImage files for all devices?
At the moment I can either have a good iPhone X transition or a good iPhone Plus transition but not both.
Is my only option to try to detect if it’s an iPhone X (or iPhone Plus) and swap the images programatically?
So here's the solution for a landscape only app. Hopefully it will help a little for portrait orientations too. Landscape bespoke launch images should be placed as shown with these width/height class settings.
Use the launchImage.xcassets screenshot at the top of the question to set up your launchImage.xcassets.

Launch Screen Image size for all iOS screen sizes

I am trying to create a lunch screen image for my iOS app. But I am not sure whats the right size for it.
According to apple website for iPhone 6 the size should be 750 x 1334 (#2x) for portrait.
But my question is, how to create a launch screen image that will fit for all screen sizes such as iPhone 5, 5s, 6, 6 plus, iPads etc?
Whats the correct way of doing this?
Go to images.xcassets
there you can see launch image sizes.Just Enable iOS version from right side.
iPhone Portrait iOS 8:- 1242*2208 (5.5 inch)
750*1334 (4.7 HD)
iPhone Landscape iOS 8:-2208*1242 (5.5inch)
iphone Portrait iOS 7,8 :- 640*960 (#2x)
640*1136 (Retina)
iPhone Portrait 5,6 :- 320*480 (#x)
640*960 (#2x)
640*1136 (retina4)
But my question is, how to create a launch screen image that will fit
for all screen sizes such as iPhone 5, 5s, 6, 6 plus, iPads etc?
That will be very hard to do. The devices have different aspect ratios and the difference in size between say iPhone 5 and iPad Air is pretty big to use one image for all. If you want to use the classical launch screen with a screenshot, resizing one image won't look the same as the user interface on different devices. If you want a launch bitmap image you will need to supply all the necessary sizes.
Whats the correct way of doing this?
You can create either launch PNG image or launch screen as a storyboard.
For launch image, your project has an assets catalog. Either use existing or add new iOS launch image. The editor will show you all required sizes.
For a storyboard, your application probably already has LaunchScreen.storyboard. You typically won't create specific size or sizes here, but use auto layout that will resize the screen appropriately.

IOS 8 Launch Screen Image iPad

I've seen many similar questions in stack overflow and I've looked at the apple guidlines but the solutions didn't work for me. My problem is that my launch screen image for iPad IOS 8 (I don't have an iPhone 6 or 6+ to test with at the moment) isn't filling the screen or displaying in landscape if the ipad is in landscape mode.
I have portrait images of my launch image one at 750x1334 (background_-my_app_name#2x.png), the other at 1242x2208 (background_-my_app_name#3x.png). What I'm seeing is a square, portrait version of my launch image whether or not it's in portrait mode.
The launch screen uiimage has the aspect ratio constraints applied and the view mode is "Scale to Fill". I can stretch it down with "Aspect Fill" but it still leaves a white border to the right and bottom. Some people have suggested using "-Portrait~ipad" and "-Landscape~ipad" as part of the image name or just using iPhone portrait and landscape images in xcassets but this didn't fix things for me. When doing this I also had landscape versions of both launch image sizes.
What naming convention do I use for launch images for iPad and iPhone 6/6+, both portrait AND landscape? And how should I set it up?
Edit:
Removing "LaunchScreen" from "Launch Screen File", and using a 750x1334 (myimage-Portrait#2x.png), 1242x2208 (myimage-Portrait#3x.png) and 2208x1242 image (myimage-Landscape#3x.png) in xcassets now means the portait version fills the screen, but the landscape one is black.

Resources