开发者

UIView Rotation No XIB

开发者 https://www.devze.com 2023-01-27 11:06 出处:网络
I have a simple window based ipad app with no extra xibs or classes, just your app delegate .h and .m.

I have a simple window based ipad app with no extra xibs or classes, just your app delegate .h and .m.

I have successfully added a UIView 开发者_运维知识库as a subview to 'window' but it has no rotation. How can I get a view added with working rotation. (No extra xib files if possible.)

Thanks.


You need a custom view controller for your view that implements the method shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation. Return YES for every orientation you wish to allow rotation to.

0

精彩评论

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