Ray Ling
Ray Ling

Reputation: 83

UIDeviceOrientationDidChangeNotification event not firing when user disable screen auto-rotation

I can receive UIDeviceOrientationDidChangeNotification event, if auto-rotation is set.

But when screen auto rotation is disable, orientation notification doesn't work any more.

The effect I want to achieve is as iPhone Camera and Camera+: whatever the user lock or not lock the screen rotation, application can correspond to the rotation change immediately and correctly.

Does anyone has any idea why notification not sent when user lock the screen rotation? How could I correspond to the device orientation change even if auto-rotation is disabled?

Upvotes: 8

Views: 2401

Answers (1)

Steph Sharp
Steph Sharp

Reputation: 11682

I also want to get the effect of the Camera app, where the app detects the orientation of the device even if the user has set Portrait Orientation Locked. UIDeviceOrientationDidChangeNotification is not posted when the user has portrait orientation locked. I believe the only way to determine the orientation of the device when the user has locked the orientation to portrait is to manually work out the orientation using UIAccelerometer.

The list of questions & answers below are all related to this issue. I found them when I was searching for an answer, and you might find them helpful too.

Related questions:

Upvotes: 4

Related Questions