Question

I added an observer of UIDeviceOrientationDidChangeNotification and the selector of the observer is orientationChanged: My app only support landscape left and landscape right, if you rotate the iPad like Turnning the steering wheel, the selector will get called perfectly. but if you rotate the iPad like rolling, the selector will be called when the iPad is nearly flat, but not flat yet, the selector will be called! how could it happen ,anyone encounter this problem?

Était-ce utile?

La solution

I guess when you rolling the observer is called orientationChanged: with one of these orientation,

UIDeviceOrientationFaceUp,
UIDeviceOrientationFaceDown

By default, an app and a view controller’s supported interface orientations are set to UIInterfaceOrientationMaskAll for the iPad.

OR

Use UIApplicationDidChangeStatusBarFrameNotification instead of UIDeviceOrientationDidChangeNotification - From the @Leon Comment.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top