问题描述
UIDeviceOrientation & 有什么区别?UIInterfaceOrientation ?
我应该使用哪一个来检测 UIView 上的旋转?
推荐答案
UIDeviceOrientation 为您提供有关物理设备本身的信息,而 UIInterfaceOrientation 则告诉您它正在显示的视图的方向.这些不需要匹配;当用户使用方向锁定或设备方向朝上时.
您可能想要检查 UIInterfaceOrientation 和 UIViewController 上的旋转方法以确定视图何时已旋转或应该旋转.