當部署資訊中的設備方向設定為僅縱向時,是否可以在objective-c中以編程方式旋轉導航欄?
uj5u.com熱心網友回復:
- 在專案設定中將允許的方向設定為縱向和橫向
- 將所有視圖控制器設定為僅允許縱向且不允許旋轉
- 在需要橫向的視圖控制器上,將首選方向設定為橫向。
override public var shouldAutorotate: Bool {
return false
}
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .landscapeRight
}
override public var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .landscapeRight
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/470154.html
上一篇:如何從檔案的屬性串列中獲取資料?
