开发者

How can I adjust a UIView for landscape orientation?

开发者 https://www.devze.com 2023-04-13 07:01 出处:网络
I have a UITableViewController with a custom UIView as a subview.When I rotate the iPhone from portrait to landscape orientation the UIView subview rotates correctly but does not resize correctly. How

I have a UITableViewController with a custom UIView as a subview. When I rotate the iPhone from portrait to landscape orientation the UIView subview rotates correctly but does not resize correctly. How can I resize the custom开发者_如何学运维 UIView when the device is rotated?


Set the UIView's autoresizingMask like so:

myView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;

This should mean that the view resizes itself automatically on rotation.

0

精彩评论

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

关注公众号