0

I'm using auto layout for my project. I use the size class "compact width" and "regular height" for all portrait iPhones. I basically designed it using iPhone 6 metrics selected in the size inspector. My questions are:

  1. I need to fix the labels and images so that they adapt to iPhone screens lower than iPhone 6, since it is bigger looking in iPhone 4s (I looked using the Preview option in storyboard).
  2. I need the navigation bar to be fixed with Auto Layout, because the navigation bar items don't fit, causing a lot of gaps on smaller screens. (Can we customize it and set constraints through code?)

So far the layout is good on iPhone 6 but not on iPhone 4s. Please help me determine whether I need to consider any startup or if there any constraint specific issues.

Eric Galluzzo
  • 3,191
  • 1
  • 20
  • 20
  • "Bigger looking on iPhone 4S"? They should be the same size. They take more of the screen because the screen is smaller, but they remain the same size. And if you make them to small, they may become unusable (remember you should keep all elements a user can interact with at least 44 pixels wide or high). – jcaron Jan 07 '16 at 18:40
  • yes, the size is same, but i need different sizes to be set according to the screen size like ratio. if i start using iPhone 4s as base metrics, then it fits but looks smaller in iPhone 6 , 6 plus. – SsoDevtest Dev Jan 08 '16 at 04:15
  • Again, it's not smaller, it takes less space on the screen because the screen is larger. For the size of elements, you can set equal width or heigh constraints against the size of the root view, with a multiplier and/or constant. Or you can use aspect ratio constraints on elements, it really depends what your layout is/what you want it to be. For font sizes, you'll have to do that programmatically in your `viewDidLoad` method – jcaron Jan 08 '16 at 15:50
  • thanks @jcaron , i try that, – SsoDevtest Dev Jan 11 '16 at 05:29

0 Answers0