I have to use launch images in imageview
of launch storyboard. But it's not supporting all orientations, and if I do scaleToFill
in contentmode
of imageview
, then the image looks stretched. Can anybody help me?
Asked
Active
Viewed 188 times
1

Arnaud
- 7,259
- 10
- 50
- 71

priyanka.saroha
- 201
- 1
- 8
-
Use autolayout and size classes – Ramaraj T Oct 23 '15 at 09:25
-
I am using autolayout and size classes. I set image to imageview from imageasset but either it takes proper image for landscape or portrait not for both. – priyanka.saroha Oct 23 '15 at 09:45
-
Do u have separate launch image for Landscape and Portraint? – Ramaraj T Oct 23 '15 at 09:58
-
Yes separate launch images are being used for Landscape and Portrait mode. – priyanka.saroha Oct 23 '15 at 10:04
1 Answers
0
If you use LaunchImage
directly, then the launch xib's wont load. If you want to load a xib with custom image for different orientation, then you have to add separate images in the asset catalogue.
Select the size classes for the image and use appropriate images.

Ramaraj T
- 5,184
- 4
- 35
- 68
-
1Yes you are correct. I have done exactly same but its not picking correct image for iPad orientations. – priyanka.saroha Oct 23 '15 at 10:47
-
For all the iPad orientations, the size class will be same. Regular-Regular. So it will load the same image. – Ramaraj T Oct 23 '15 at 11:16