preface

Recently, when I wrote the UI of the software, I found that the rotation of the screen would affect the display of the layout. Due to the short development period, there was not enough time to do the detailed layout adaptation, so I decided to prohibit the application of portrait display. The process is shown below, and hopefully it will be helpful to others.

steps

1. Set Device Orientation

In TARGETS -> General ->Deployment, locate Device Orientation and set the supported display direction for the Device.

2. Set Supported interface orientation

On TARGETS -> Info -> Custom iOS Target Properties, set Supported Interface Orientation. Note that there are options for both iPhone and iPad.



Once you’ve done that, the app is only allowed to show up in portrait on the phone.

Data collected

The bad place that writes welcomes everybody to point out, hope everybody leaves a message to discuss more, let us progress together!

Those who like iOS can pay attention to me and study together!!

reference

www.jianshu.com/p/848ec0f65… Link: blog.csdn.net/weixin\_422…