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开发者们能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对毛票票的支持。
热门推荐
10 爱情祝福语大全 简短实际
11 八一幼儿祝福语大全简短
12 永远漂亮祝福语女生简短
13 女朋友祝福语简短新年
14 入伙英文祝福语大全简短
15 六一婚礼文案祝福语简短
16 蛋糕生日弥勒祝福语简短
17 周一情人祝福语简短
18 夸赞老师祝福语搞笑简短