ios啟動頁強制豎屏(進入App后允許橫屏與豎屏)
這篇文章主要介紹了在ios啟動頁強制豎屏,進入App后允許橫屏與豎屏的相關資料,需要的朋友可以參考下。
方法如下
1、修改App-info.plist(在XCode中General中設置 一樣的效果)
<key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> </array>
2、AppDelegate中:
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
貼一下蘋果對這個的解釋,可以放心使用:
Discussion
This method returns the total set of interface orientations supported by the app. When determining whether to rotate a particular view controller, the orientations returned by this method are intersected with the orientations supported by the root view controller or topmost presented view controller. The app and view controller must agree before the rotation is allowed.
If you do not implement this method, the app uses the values in the UIInterfaceOrientation key of the app's Info.plist as the default interface orientations.
總結
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對各位iOS開發(fā)者們能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對腳本之家的支持。
相關文章
iOS開發(fā)--仿新聞首頁效果WMPageController的使用詳解
這篇文章主要介紹了iOS開發(fā)--仿新聞首頁效果WMPageController的使用詳解,詳解的介紹了iOS開發(fā)中第三方庫WMPageController控件的使用方法,有需要的可以了解下。2016-11-11
詳解 swift3.0 可選綁定共用同一塊內(nèi)存空間的實例
這篇文章主要介紹了詳解 swift3.0 可選綁定共用同一塊內(nèi)存空間的實例的相關資料,希望通過本文能幫助到大家,需要的朋友可以參考下2017-09-09
iOS內(nèi)存管理Tagged Pointer使用原理詳解
這篇文章主要為大家介紹了iOS內(nèi)存管理Tagged Pointer使用原理詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-01-01

