简体   繁体   中英

I have the device orientation of my app (iOS/ Swift) set to portrait only, however the screen still rotates?

Picture of deployment settings

As you can see in the picture, I have set my device orientation to portrait only, but the app will still rotate. I am coding completely programmatically, so there is no storyboard. Any Ideas?

After some headache I found that the reason it was acting up was because, I had not selected A Main interface in the "general" Target menu. This mistake started because I had deleted my storyboard to code UI programmatically. If you do the same select "LaunchScreen.storyboard", and your app will work normal.

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