当前位置: 移动技术网 > IT编程>移动开发>IOS > ios启动页强制竖屏(进入App后允许横屏与竖屏)

ios启动页强制竖屏(进入App后允许横屏与竖屏)

2019年07月24日  | 移动技术网IT编程  | 我要评论

window7旗舰版激活,二嫁嗜血八王爷txt,猛鬼入侵黑社会高清

这篇文章主要介绍了在ios启动页强制竖屏,进入app后允许横屏与竖屏的相关资料,需要的朋友可以参考下。

方法如下

1、修改app-info.plist(在xcode中general中设置 一样的效果)

 <key>uisupportedinterfaceorientations</key>
 <array>
  <string>uiinterfaceorientationportrait</string>
 </array>

2、appdelegate中:

- (uiinterfaceorientationmask)application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window {
 return uiinterfaceorientationmaskallbutupsidedown;
}

贴一下苹果对这个的解释,可以放心使用:

discussion

this method returns the total set of interface orientations supported by the app. when determining whether to rotate a particular view controller, the orientations returned by this method are intersected with the orientations supported by the root view controller or topmost presented view controller. the app and view controller must agree before the rotation is allowed.

if you do not implement this method, the app uses the values in the uiinterfaceorientation key of the app's info.plist as the default interface orientations.

总结

以上就是这篇文章的全部内容了,希望本文的内容对各位ios开发者们能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对移动技术网的支持。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网