My app is a portrait app, now I want to put a view controller in landscape. There's a easy way to do that? I set the device info only in portrait now I've a view controller in which there are a media player and I think it's better to watch this video in landscape mode. I tried this methods:
- (BOOL)shouldAutorotate
: doesn't work - (NSUInteger)supportedInterfaceOrientations
: doesn't works You know if there's a way to solve this without redo all app inserting category?
You have 2 things to do :
Set the supported device orientations on the target info
Set the (NSUInteger)supportedInterfaceOrientations
method for your viewController. If this view is only supposed to show the video I guess you should only allow UIInterfaceOrientationMaskLandscape
.
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.