Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView autoresizingMask problem

In iPad. I have a UIViewController with another UIview inside it, at the bottom.

 ____________
|            |
|            |
|   UIView   |
| Controller |
|            |
|            |
|         X  |
 ------------

The UIView is the X.

I define for it an autoresizingMask like this, on the viewDidLoad of the UIViewController

self.view.autoresizeSubviews = YES;

// xView creation

xView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;

But this doesn't works, the xView rotates fine but out of the screen bounds on landscape.

What I'm missing?

like image 931
emenegro Avatar asked Jun 18 '10 12:06

emenegro


1 Answers

If you want the view to be at lower-right corner, it should have a flexible left and top margin.

 xView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | 
                          UIViewAutoresizingFlexibleTopMargin;
like image 191
kennytm Avatar answered Nov 14 '22 04:11

kennytm