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开发者们能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对毛票票的支持。
热门推荐
7 简短的二胎祝福语
10 简短霸气女儿生日 祝福语
11 祝福语高考小众诗句简短
12 元旦祝福语20秒简短
13 老师过年祝福语大全 简短
14 一生祝福语简短
15 产检祝福语简短霸气
16 朋友店开张祝福语简短
17 生日爱情祝福语大全简短
18 朋友女儿生日祝福语 简短