How to make orientation determination, even if the device has a locked orientation

I wonder how to perceive changes in orientation, even if the current orientation of the device is locked (by double-clicking the home button and pressing the lock icon in the gray orientation)

However, I saw a video receiving applications ( UIImagePickerController ) that can perceive orientation changes and change control orientation.

I know that to detect a change, I can use:

 - shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation - UIDeviceOrientationDidChangeNotification 

but none of these methods work if the orientation of the device is locked.

0
source share
1 answer

You can use accelerometer to get current orientation, check iPhone Screen Orientation Definition

+1
source

All Articles