Background image does not fit

Discussion in 'iOS Programming' started by PlutoM4, Apr 19, 2014.

  1. PlutoM4 macrumors newbie

    Apr 11, 2014
    Hi all!

    I'm wondering why I get this kind of view on simulator:

    4 inch:

    3.5 inch:

    I have two images, called "pinup.png" at 320x480 and "pinup@2x.png" at 640x960. I tried both changing background programmatically and using an ImageView.

    As you can see, in 3.5 simulator image has cutted legs and doesn't fit properly. Any hint to solve this annoying issue?

    Thanks in advance! :)
  2. mds1256 macrumors regular

    Apr 9, 2011
    Looks like you need to add some Auto Layout constraints on to the UIImageView, this should allow the UIImageView to change its height depending on what device it is on.
  3. PlutoM4 thread starter macrumors newbie

    Apr 11, 2014

    You're right, I'm just adding constraints and it works perfectly!

    Thanks mate!


Share This Page