Launch screen storyboard for multiple devices and different orientations in iOS
Asked Answered
P

1

8

My application supports all devices from 4 inch onwards in both orientations.

iPhone - 5, 5S, 5C, 6, 6S, 6+, 6S+, SE

iPad 4, iPad Air, iPad Air2, iPad Pro etc

Using asset catalog for launch screen its working fine but in iPad Pro app displays standard keyboard rather iPad Pro optimized keyboard which is bigger and doesn't give best user feel.

As per below link app should be using launch storyboard rather than asset images to get optimized iPad Pro native keyboard.

https://forums.developer.apple.com/thread/26357

Now question is how to support both orientations during launch screen storyboard ?

How to add different launch images for portrait and landscape modes in storyboard ? Using size class for iPad in both orientations its both Regular and Regular size.

Note - Because it launches a screen storyboard, one can't customize the size class with custom class.

Psoriasis answered 6/9, 2016 at 12:28 Comment(3)
Don't understand why its -ve rank. This is no where documented clearly about this point and i believe its 100% technical question.Psoriasis
It was probably the request for priority attention that irritated a reader. Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.Victim
Thanks for making me aware of why it was down voted and providing me guidelines in posting a query. This will help and I will note this point in my future Questions.Psoriasis
G
5

In your launchsScreen.storyboard add imageView and set it's four constraints like : top,bottom,leading,trailing.

Now, in your assets add separate images for iPhone and iPad with 1x,2x,3x resolution for iPhone and 1x,2x for iPad.

And set that image to that imageview. It will manage then for every device!

You can set different images for different size class in assets. So for different orientation you can set different images in assets.

refer Apple documentation for more details.

And yes you can use vector graphics as suggested in comment by @pkc456 to keep your app light weight.

Gloom answered 6/9, 2016 at 12:40 Comment(11)
I recommend to use vector graphics rather than adding separate images for 1x,2x,3x resolution.Electrotechnics
yeah, then one higher resolution image is enough!!Gloom
No. We need @1x image while working with vector graphics.Electrotechnics
But image's resolution should be high!Gloom
Thanks Ketan for the response. I guess either you use asset catalog or size specific images in storyboard, for iPad in both orientations its regular size. My issue is i couldn't differentiate which image to use in landscape mode.Psoriasis
you should use story board for launch screen and add new image set in asset as you add for normal image. and set that image in launch screen's imageview.Gloom
@KetanParmar, Vector drawables scales without losing image quality. We need only one asset file(.pdf in 1x size) for multiple vector images. Read in detail here and martiancraft.com/blog/2014/09/vector-images-xcode6Electrotechnics
yeah i know, what i am saying that, pdf contains high resolution image!!Gloom
@Ketan, I haven't used image asset for landscape and portrait purpose. 2 things 1. In New Image Set you don't see portrait / landscape checkbox option unlike in launch image set. 2. In regular image set - How to add images for iPad portrait and landscape ? iPads are regular in both horizontal and vertical size classes. For iPhones yes we can add this because portrait and landscape modes are taking different size classes !!Psoriasis
then add common image for ipad because it will use same for both landscape and portrait!!!!Gloom
What resolutions should I use for 1x, 2x and 3x if I want a full-screen image view in my launch screen?Viscount

© 2022 - 2024 — McMap. All rights reserved.