开发者

UIView autoresizingMask problem

开发者 https://www.devze.com 2023-01-03 18:32 出处:网络
In iPad. I have a UIViewController with another UIview inside it, at th开发者_运维问答e bottom.

In iPad. I have a UIViewController with another UIview inside it, at th开发者_运维问答e 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?


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

 xView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | 
                          UIViewAutoresizingFlexibleTopMargin;
0

精彩评论

暂无评论...
验证码 换一张
取 消