How do you Implement Landscape Launch Screen for iPhones? - ios

How do you implement landscape launch screens for iPhones? I've seen the "plist duplicate" posts and added the arrays they suggested to my plist, and added my launch images to my xcassets file which is set as my launch image so it shows as just a black screen. when removing assets catalogue, theres a bar of black on both the left and right side of the screen the whole time the app is running. Also, if its not done through cassettes, what do you name the images and where do they go? Thanks!

Are you asking about launch images or launch screens?
There's no such thing as a landscape launch image for iPhone. You provide a normal launch image in portrait, and if the app launches in landscape, that launch image is automatically turned on its side.
But in this day and age it would be best to forget about launch images and use a launch screen, a xib file or storyboard. It knows nothing of orientation and doesn't need to know anything: you just configure its appearance using autolayout to match whatever the circumstances turn out to be.

Related

Abandon image cassetts for LaunchScreen.storyboard

So I have a fairly old app, last time worked on before iPhone X(s) was released. Always used Launch Images Source instead of Launch Screen File as seen below.
I am now having issues launching on iPhone X, as the screen size is assumed from the LaunchImage and there is NO launch image currently provided for iPhone X(s) in the "LaunchImage" file of .xcassets folder.
What is the most straightforward way to abandon using cassets in use of the new "Launch Screen File"? I have already tried creating this and using it, but had no luck getting an UIImageView to resize an image with said screen sizes on devices.
Im really looking for a straightforward guide for creating a LaunchImage.storyboard file that can adapt a launch screen image(full-sized image) to any device size.
What is the most straightforward way to abandon using cassets in use of the new "Launch Screen File"?
Change the Launch Images Source pop-up menu to "Don't use asset catalogs".
Make a LaunchScreen.storyboard if there isn't one, and point Launch Screen File at it. Make sure your launch image storyboard uses autolayout and is designated as a launch screen.
Now configure your storyboard's view controller using autolayout so that it lays out correctly on all devices.

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.

image view only shows background color in launch screen

I'm having some problems with my app's launch screen storyboard.
When I run the app on an iPhone 5S, the image is displayed. However, when I run the app on an iPhone 8, the background color of the UIImageView is shown.
In the project settings, at App Icons and Launch Images, I am not using an image source (although trying do so doesn't seem to work either) and the Launch Screen File is set to LaunchScreen.
The View Controller has Is Initial View Controller checked and the file has Use as Launch Screen checked. The image set was brought in using Import... and is universal.
I've read through several of the solutions for black screen here, but switching the background color revealed that was where my black screen was coming from.
In the assets file, the image set has 1x # 640x1136, 2x # 1242x2208 & 3x # 1125x2436. I experimented with other combinations, but this is the first set that let me see the actual image on the 5S. I'm pretty sure the issue is not having the right configuration of dimensions in the image set file, but can't be certain.
Any help would be much appreciated. Thanks in advance.
Had the same thing. Working on the simulator but didn't work on the device (or any other possible option). It's just a bug.
Try these until it works:
Turn simulator/device off and then on again.
Hard clean simulator. Turn it off.
Clean/Hard Clean/Delete Derived data
Reboot Xcode
Hope one of these helps.
If not, please include the screenshots of working / non-working app screens.

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.

look and feel of app in launch image and launch screen

I created an app in xamarin ios and used launch image option to show the launch screen. Now I replaced the launch image with launch screen (.xib file). But after changing to launch screen from launch image the look and feel of my app is also affected. Now the fonts are looking small and controls on screens are also looking little small. The size of fonts and other controls are same in both cases but looking different in both launch image case and launch screen case.
I really don't know what is the problem in it, why app looks different in both cases.
Does anyone have any idea why does it happen?

Resources