简体   繁体   中英

Force orientation and disable rotation based on device at App Delegate level?

I have a universal app for iPhone and iPad. I would like to restrict the orientation of my app to only portrait on the iPhone (for all views) and only landscape on the iPad (for all views). In addition to this, I'd like to disable orientation change / autorotate.

I'd like to enforce / set these requirements at an application / app delegate level and not on a per viewcontroller level.

Any help would be appreciated!

The info.plist keys for supported orientations have separate entries for iPhone and iPad. You can set those up to control the settings app-wide.

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