Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kevy089

macrumors newbie
Original poster
Apr 5, 2009
5
0
Hi,

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.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
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.
 

kevy089

macrumors newbie
Original poster
Apr 5, 2009
5
0
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?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.