ios启动页强制竖屏(进入App后允许横屏与竖屏)
这篇文章主要介绍了在ios启动页强制竖屏,进入App后允许横屏与竖屏的相关资料,需要的朋友可以参考下。
方法如下
1、修改App-info.plist(在XCode中General中设置一样的效果)
UISupportedInterfaceOrientations UIInterfaceOrientationPortrait
2、AppDelegate中:
-(UIInterfaceOrientationMask)application:(UIApplication*)applicationsupportedInterfaceOrientationsForWindow:(UIWindow*)window{
returnUIInterfaceOrientationMaskAllButUpsideDown;
}
贴一下苹果对这个的解释,可以放心使用:
Discussion
Thismethodreturnsthetotalsetofinterfaceorientationssupportedbytheapp.Whendeterminingwhethertorotateaparticularviewcontroller,theorientationsreturnedbythismethodareintersectedwiththeorientationssupportedbytherootviewcontrollerortopmostpresentedviewcontroller.Theappandviewcontrollermustagreebeforetherotationisallowed.
Ifyoudonotimplementthismethod,theappusesthevaluesintheUIInterfaceOrientationkeyoftheapp'sInfo.plistasthedefaultinterfaceorientations.
总结
以上就是这篇文章的全部内容了,希望本文的内容对各位iOS开发者们能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对毛票票的支持。
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短