简体   繁体   中英

Set orientation landscape for a view controller

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.

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