Aligning Images and Buttons Using Multiple Views

Discussion in 'iPhone/iPad Programming' started by kevy089, Apr 14, 2009.

  1. macrumors newbie


    I am creating an application with a main view and six other views that load into the main view. All of the views contain a different image that are the same size(1053x598) and all have the same set of buttons at the bottom. I am using Interface Builder. How can I make sure that ALL of the images and buttons are positioned in the same location in ALL of my views... Meaning... when I switch views I want the images and buttons to be in the exact same spot as the view I just switched from. Thank You.
  2. macrumors 68030


    Since the image is larger than the screen size does that mean that they're in a scrollview? If so the contentOffset property of the scrollview indicates how the content view has been scrolled. Just read the contentOffset from the current view and use that to set the contentView for the new view.

    If you're not using a scrollview then tell us how the images and buttons are laid out.
  3. macrumors newbie

    Thanks... I am forcing the app to load in landscape mode... Is this the incorrect size to use for my images still? I am basically adding the images to my resource folder in xcode then adding them to my views in interface builder. As for the buttons, I am creating them in interface builder as well. My hope is that I am able to align all the views using interface builder. Is that possible?
  4. macrumors 68030


    The screen size is 480x320 so your images are obviously much larger than that. If they can't scroll then I don't understand the point of having them that size.

    You can certainly have several views set up with the same positions for buttons and other subviews and switch between them. You could also have a single view hierarchy and just switch an image in an imageview.

Share This Page