Help. Adjust position of subviews automatically when rotate to landscape position.

Discussion in 'iOS Programming' started by cthesky, Dec 20, 2011.

  1. cthesky macrumors member

    Aug 21, 2011
    Hi all,

    In my IPad project, I had align and set the position of image view at the center of a portrait view. It work nicely when the orientation of IPad is in portrait view but when I rotate it to landscape orientation, the image view not at the certer but is at the left side.

    So, is it a way to make subviews (image view) position automatically based on the orientation of view? Or I need set the position of image view programmatically by checking the current orientation of device? Or I need set the autoresizing property of subviews under Size Inspector in interface builder?

    Any suggestions and comments are welcome. Thanks a lot. :)
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    This is how I'd do it.

Share This Page