本文主要是介绍IOS开发-在UIViewController中锁定竖屏,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
转自:http://www.jianshu.com/p/6ebfc7294e13
因为APP中有视频播放,所以不能全局锁定,只能在一些实在不想横屏的Controller中进行锁定
代码如下:
override func shouldAutorotate() -> Bool {return false}override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {return UIInterfaceOrientationMask.Portrait}override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {return UIInterfaceOrientation.Portrait}
这篇关于IOS开发-在UIViewController中锁定竖屏的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!