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 婆婆高寿祝福语大全简短