强制将单个视图设置为不同的方向以设置设备方向

时间:2016-01-29 22:34:05

标签: ios xcode swift rotation orientation

我看到这个问题以多种形式发布,但答案要么不适合我,要么是obj-C。在我的项目设置中,我将所有视图的设备方向设置为纵向。如何仅强制单个视图显示横向(禁用旋转)?

1 个答案:

答案 0 :(得分:0)

使用此功能可将方向设置为横向左,右或横向

override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
   return UIInterfaceOrientationMask.LandscapeLeft; // can also do .Landscape or .LandscapeRight
}