Background Image

Discussion in 'iOS Programming' started by rheb1026, Jul 28, 2012.

  1. rheb1026 macrumors member

    Joined:
    Jun 19, 2011
    Location:
    Taxachusetts
    #1
    Hi all,

    I'm fairly new to programming, but I've been working on an app that I need to set a background image and have it remain static when the iPhone is rotated.

    What is the easiest way to go about doing this? I've tried adding an image view to the .xib and just assigning the image to that, but whenever the app rotates the image either shrinks or expands depending on the view "mode" chosen in the attributes inspector

    Thanks for any help
     
  2. CodeBreaker macrumors 6502

    Joined:
    Nov 5, 2010
    Location:
    Sea of Tranquility
    #2
    Every view in UIKit has a property called autoResizingMask. If you don't want to stretch the image, set it's imageView's autoResizingMask to UIViewAutoresizingNone.
     
  3. rheb1026 thread starter macrumors member

    Joined:
    Jun 19, 2011
    Location:
    Taxachusetts
    #3
    Thanks for the info; I had actually used this earlier in my program, but it completely slipped my mind to use it for that too. I appreciate the quick response
     

Share This Page