ios啟動(dòng)頁強(qiáng)制豎屏(進(jìn)入App后允許橫屏與豎屏)
這篇文章主要介紹了在ios啟動(dòng)頁強(qiáng)制豎屏,進(jìn)入App后允許橫屏與豎屏的相關(guān)資料,需要的朋友可以參考下。
方法如下
1、修改App-info.plist(在XCode中General中設(shè)置 一樣的效果)
<key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> </array>
2、AppDelegate中:
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskAllButUpsideDown; }
貼一下蘋果對這個(gè)的解釋,可以放心使用:
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.
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對各位iOS開發(fā)者們能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對腳本之家的支持。
相關(guān)文章
iOS sqlite對數(shù)據(jù)庫的各種操作(日常整理全)
在IOS中使用Sqlite來處理數(shù)據(jù)。如果你已經(jīng)了解了SQL,那你可以很容易的掌握SQLite數(shù)據(jù)庫的操作。本文給大家介紹iOS sqlite對數(shù)據(jù)庫的各種操作,需要的朋友參考下吧2016-03-03iOS內(nèi)存錯(cuò)誤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的問題,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-03-03iOS實(shí)現(xiàn)一個(gè)意見反饋類型的輸入欄
這篇文章主要給大家介紹了關(guān)于利用iOS實(shí)現(xiàn)一個(gè)意見反饋類型的輸入欄,通過文中實(shí)現(xiàn)的輸入欄會(huì)用戶一個(gè)很好的體驗(yàn)效果,文中給了詳細(xì)的示例代碼,需要的朋友可以參考借鑒,下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。2017-10-10