Background image does not fit

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

  1. PlutoM4 macrumors newbie

    Joined:
    Apr 11, 2014
    #1
    Hi all!

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

    4 inch:
    http://awesomescreenshot.com/0ce2ofa8ef

    3.5 inch:
    http://awesomescreenshot.com/0472ofahc2

    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

    Joined:
    Apr 9, 2011
    #2
    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

    Joined:
    Apr 11, 2014
    #3
    Bingo!

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

    Thanks mate!

    ;)
     

Share This Page