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开发者们能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对毛票票的支持。
热门推荐
6 保研的祝福语简短
10 年轻20岁祝福语简短
11 朋友结婚祝福语信息简短
12 女孩婚礼贺卡祝福语简短
13 30段点歌简短祝福语
14 虎年春节祝福语图文简短
15 写给后妈祝福语大全简短
16 简短回复生日祝福语
17 校长送毕业祝福语简短
18 毕业立体贺卡祝福语简短