0

I have some pretty basic UI in my app.

Originally, on 4 inch display it looks like this:

enter image description here

But when I switch to 3.5 inch in story board, the image view seems to change height, and other controls remain on the same positions (which is what I wanted).

On 3.5 inch:

enter image description here

I don't want the image view to change size when on 3.5 or 4 inch mode, how to achieve this?

Since this is somewhat easy UI, I was thinking to avoid using auto layout. If objects remain on the same place, and keep sizes, when switching between 3.5 and 4 inch screen, I should be OK, because I can fit this UI both on smaller and wider screens.

Dirk
  • 10,668
  • 2
  • 35
  • 49
  • What layout constraints have you installed? – bgfriend0 Mar 08 '14 at 17:47
  • @bgfriend0: I didn't install any –  Mar 08 '14 at 17:47
  • You've done nothing whatsoever to alter the height of that imageView? In any way? Is it supposed to always be a certain height? If so, have you tried installing a height constraint? – bgfriend0 Mar 08 '14 at 17:53
  • @bgfriend0: Like I said, since this app had some basic UI I was trying to avoid to have to learn auto layout :) –  Mar 08 '14 at 18:04

2 Answers2

0

Hm, you can resize elements with this: photo

nemelianov
  • 911
  • 1
  • 7
  • 15
  • hmm,.. it works this way, but for this I had to turn off the "use Autolayout" feature in Story board. Is this a good idea? Accepted practice? –  Mar 08 '14 at 17:33
  • Yep, I have so expirience with it, resizing buttons and label between 3.5 inch and 4.0 inch iPhones. – nemelianov Mar 15 '14 at 18:09
0

If you want the image size to remain untouched, and you are using autolayout, simply pin width and height in storyboard by selecting the image view and then adding the constraints like this (your numbers will be different):

Pin Width and Height in IB

Jorge
  • 2,530
  • 1
  • 19
  • 28
  • Like I said I was thinking to avoid auto layout since I don't know it, I solved the issue using auto resizing masks - see the other answer. Are they equivalent, if I solved the problem with auto resizing mask - can I forget this issue? (I don't mind doing it with auto layout just I am unfamiliar with it yet, and was thinking to avoid learning it at this stage - also since this app has some basic UI) –  Mar 08 '14 at 18:03
  • You can do it as you like. Autolayout is the newest way. It expresses things in relative terms instead of using absolute values. To use it or not is completely your choice. You can get more information here: http://stackoverflow.com/questions/18739033/ios-autolayout-vs-springs-struts – Jorge Mar 08 '14 at 18:23
  • FYI, autoresizing masks are turned into auto layout constraints under the hood. – bgfriend0 Mar 08 '14 at 18:55