ios啟動(dòng)頁(yè)強(qiáng)制豎屏(進(jìn)入App后允許橫屏與豎屏)
這篇文章主要介紹了在ios啟動(dòng)頁(yè)強(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;
}
貼一下蘋(píng)果對(duì)這個(gè)的解釋?zhuān)梢苑判氖褂茫?/strong>
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é)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)各位iOS開(kāi)發(fā)者們能帶來(lái)一定的幫助,如果有疑問(wèn)大家可以留言交流,謝謝大家對(duì)腳本之家的支持。
相關(guān)文章
iOS開(kāi)發(fā)--仿新聞首頁(yè)效果WMPageController的使用詳解
這篇文章主要介紹了iOS開(kāi)發(fā)--仿新聞首頁(yè)效果WMPageController的使用詳解,詳解的介紹了iOS開(kāi)發(fā)中第三方庫(kù)WMPageController控件的使用方法,有需要的可以了解下。2016-11-11
解決Alamofire庫(kù)在iOS7下設(shè)置Head無(wú)效的問(wèn)題
本文主要介紹Alamofire庫(kù)在iOS下設(shè)置Head,這里通過(guò)代碼實(shí)例解決不同版本的IOS系統(tǒng)出現(xiàn)的問(wèn)題,有需要的小伙伴可以參考下2016-07-07
詳解 swift3.0 可選綁定共用同一塊內(nèi)存空間的實(shí)例
這篇文章主要介紹了詳解 swift3.0 可選綁定共用同一塊內(nèi)存空間的實(shí)例的相關(guān)資料,希望通過(guò)本文能幫助到大家,需要的朋友可以參考下2017-09-09
iOS內(nèi)存管理Tagged Pointer使用原理詳解
這篇文章主要為大家介紹了iOS內(nèi)存管理Tagged Pointer使用原理詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-01-01
IOS 開(kāi)發(fā)之應(yīng)用喚起實(shí)現(xiàn)原理詳解
這篇文章主要介紹了IOS 開(kāi)發(fā)之應(yīng)用喚起實(shí)現(xiàn)原理詳解的相關(guān)資料,需要的朋友可以參考下2016-12-12

