0

我有一个UIScrollView带有子视图的子视图,我必须在方向更改时更新其框架。我一直在iPhone模拟器上运行该程序,但看起来UIDeviceOrientationDidChangeNotification它没有返回设备的正确方向。UIInterfaceOrientationPortrait当我旋转时它会返回,UIInterfaceOrientationLandscapeLeft/Right反之亦然。我没有正确使用它还是必须使用其他处理方向变化的方法?

4

1 回答 1

2

UIInterfaceOrientation!= UIDeviceOrientationUIInterfaceOrientation被宣布为...

typedef enum : NSInteger {
   UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
   UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
   UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
   UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;

...纵向包含相同的值/数字,但是交换了横向变体等。您没有显示代码,因此,我可以假设您将这两个东西混合在一起。

你有什么理由不使用willRotateTo..., willAnimateRotation...,didRotateFrom...的方法UIViewController吗?

于 2014-03-17T13:22:30.480 回答