views:

593

answers:

1

I have an iphone app, with a view (well multiple but let's say one at a time). The view is very simple just some text-fields and images on there. I have set the auto-resizing attributes for those controls so that they know that they need to be centered no matter what the orientation is. There is no code that moves them or anything, everything is in IB.

The views only re-orient correctly if i change to landscape on the main view and then transition to the other views. If I go to any view on portrait and then try to go to landscape, the iphone performs the animation for rotation, but my controls don't seem to move to the right places. When i test the orientation in IB, it seems to re-orient correctly.

Why does that happen? How can I fix it?

+1  A: 

I find I have to set reset the frame of my main view for changing orientation:

CGRect mainViewFrame = CGRectMake(0.0, 0.0, 320, 480);
[self.view setFrame:mainViewFrame];
ordord00
ok i will try that when i get home tonight. Do I do that when I detect an orientation change?
fnCzar
yeap that worked. Thank you so much for the quick reply!
fnCzar