我有一个UIViewController,可以从中打开MPMoviePlayerViewController,在此之前,不允许VC旋转,也不允许VC旋转,但是允许播放器。因此,如果我将播放器旋转到横向,然后将其关闭,则未旋转的VC也处于横向。我已经准备好防止它旋转,我只想知道是否有办法在关闭播放器后强制VC检查其旋转。
感谢您的任何帮助
最佳答案
要检查方向,请使用UIDevice Orientation
[[UIDevice currentDevice] orientation]
改变方向->
目标-c:
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
迅速:
let value = UIInterfaceOrientation.Portrait.rawValue
UIDevice.currentDevice().setValue(value, forKey: "orientation")
关于ios - 强制uiviewcontroller旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35921630/