简体   繁体   中英

Change orientation without rotating device

I have app that's mainly in Landscape orientation ... and I have 2 views that are in portrait and they appear when it's changing it's orientation. So far so good.

But on one of those views I have a button that has to push a view in Landscape orientation without rotating the ipad.

How can I achiev this ?

Thank you in advance.

在界面构建器中将所需的横向视图设置为“横向”(可能是继承的),并设置“应当自动旋转”方法以仅对横向返回true。

you can set device orientation whatever you want by this method at any time.

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];

this will give you warring that this method is deprecated but it's work fine still iOS 5.1 update so no need to about warning while using this method.

Hope this may help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM