前言
最近寫軟件的 UI 發(fā)現(xiàn),屏幕旋轉(zhuǎn)會(huì)影響布局的展示,由于開發(fā)的周期比較短,來不及做精細(xì)的布局適配,所以我決定禁止應(yīng)用豎屏展示。處理過程如下文所示,希望對(duì)他人也有幫助。
操作步驟
1. 設(shè)置 Device Orientation
在 TARGETS -> General ->Deployment 中找到 Device Orientation,設(shè)置設(shè)備支持的展示方向。

2. 設(shè)置 Supported interface orientation
在 TARGETS -> info -> Custom iOS Target Properties 中,設(shè)置 Supported interface orientation,注意有 iPhone 和 iPad 兩種設(shè)備的選項(xiàng)。

完成這些操作后,應(yīng)用只允許在手機(jī)上豎屏展示了。