0

I had an application which is used for portrait only iphone.So i set the size classes to compact width and regular height as suggested.But when i am adding an imageview which is 400*800 and its 2x,3x its not showing properly in iPhone 4s.But it is not showing correctly in 3.5 inch phones,I am getting this in launch screen storyboard which i filled with one imageview.Can anybody guide me in right direction in achieving this ?

hacker
  • 8,919
  • 12
  • 62
  • 108

1 Answers1

0

Size classes are based on ratio of width and height, not size. In portrait, iPhone 6, iPhone 5, and iPhone 4s all use the compact horizontal and regular vertical size classes. So They could look different on each.

When you design UI Interface for 3.5 inch iPhone in Storyboard, you should set the Size to iPhone 3.5-inch in Attributes Inspector. By doing this, we ensure what we will see in simulator is same as in Storyboard.

enter image description here

Sometimes, You may need to make size class specifically for portrait 3.5 inch (iPhone 4S).Then you need to set auto layout according to the size of screen, like:

 if (UIScreen.mainScreen().bounds.size.height == 480) {
     //Set your auto layout here
 }
ilovecomputer
  • 4,238
  • 1
  • 20
  • 33
  • But the compact width and regular height is saying its for all iphones in portrait so as iphone 4s – hacker Jun 05 '16 at 11:50