views:

1025

answers:

1

Hello,

I have been trying to resize my view inside a view Controller with no luck so far. Basically I have a button at the very bottom of my view and when the orientation changes from Portrait to Landscape the button is no longer visible, because its just too far down now.

How can I resize this view so that when the orientation changes the button is still visible?. I have tried setting

self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

and basically every other possible combination, with no luck so far. I know I can do this by manually repositioning the button, but is there a better way to do this?.

Thank you.

-Oscar

+2  A: 
  1. The view containing the button must be auto-resized using your mask (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight).
  2. On the containing view autoresizesSubviews must be set to YES.
  3. The button must use UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin.
Nikolai Ruhe
Thank you that worked great.
OscarMk