我有一个UIScrollView
带有子视图的子视图,我必须在方向更改时更新其框架。我一直在iPhone
模拟器上运行该程序,但看起来UIDeviceOrientationDidChangeNotification
它没有返回设备的正确方向。UIInterfaceOrientationPortrait
当我旋转时它会返回,UIInterfaceOrientationLandscapeLeft/Right
反之亦然。我没有正确使用它还是必须使用其他处理方向变化的方法?
1 回答
2
UIInterfaceOrientation
!= UIDeviceOrientation
。UIInterfaceOrientation
被宣布为...
typedef enum : NSInteger {
UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;
...纵向包含相同的值/数字,但是交换了横向变体等。您没有显示代码,因此,我可以假设您将这两个东西混合在一起。
你有什么理由不使用willRotateTo...
, willAnimateRotation...
,didRotateFrom...
的方法UIViewController
吗?
于 2014-03-17T13:22:30.480 回答