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 sqlite對數(shù)據(jù)庫的各種操作(日常整理全)
在IOS中使用Sqlite來處理數(shù)據(jù)。如果你已經(jīng)了解了SQL,那你可以很容易的掌握SQLite數(shù)據(jù)庫的操作。本文給大家介紹iOS sqlite對數(shù)據(jù)庫的各種操作,需要的朋友參考下吧2016-03-03
iOS內(nèi)存錯誤EXC_BAD_ACCESS的解決方法
iOS開發(fā),最郁悶的莫過于程序毫無征兆地就崩潰了,用bt命令打出調(diào)用棧,給出的是一堆系統(tǒng)EXC_BAD_ACCESS的信息,根本沒辦法定位問題出現(xiàn)在哪里2013-06-06
解決蘋果ios用js的Date()出現(xiàn)NaN的問題
下面小編就為大家分享一篇解決蘋果ios用js的Date()出現(xiàn)NaN的問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-03-03

