Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 423
Ray Ling Avatar asked Aug 02 '12 07:08

Ray Ling


People also ask

Can you disable screen auto rotation?

Method two: Disable Auto-rotate from Display Settings Right-click the Desktop, then select Display settings. Under Display, switch Lock rotation of the display to off to lock the auto-rotation.

Why does my screen rotation keep turning off?

Enable Auto rotate Next, you'll have to check if you have turned on the autorotate feature, and it is not locked to portrait only. You can find this feature in the Quick Settings menu. If you see a Portrait icon, then it means auto-rotate is disabled, and then tap it to enable the auto-rotate.

How do I stop the screen from rotating in react native?

Screen orientation lock​ For Android, open the AndroidManifest. xml file and within the activity element add 'android:screenOrientation="portrait"' to lock to portrait or 'android:screenOrientation="landscape"' to lock to landscape.

How do I stop my game from rotating?

For Android users: Swipe your finger down from the top of the screen to bring up your quick settings toolbar. You will have an option for rotation that can be tapped to turn off the rotation lock.

How to turn off screen rotation in Action Center?

Checking screen rotation settings. 1 Use the Windows key + A keyboard shortcut to open Action Center. 2 Click the Expand button. 3 Click the Rotation lock to turn it off. 3.1 Quick Tip: You can also control this option under Scale and layout on Settings > System > Display.

How do I turn off auto rotation on Windows 10?

If this is the case, do the following: Use the Windows key + A keyboard shortcut to open Action Center. Click the Expand button. Click the Rotation lock to turn it off. Quick Tip: You can also control this option under Scale and layout on Settings > System > Display. Change the orientation of the device to see if it rotates automatically.

How to fix Android screen auto rotate not working?

Fix Android Screen Auto Rotate Not Working 1 Restart your Android phone. Most of the time a simple restart can fix all the issues your phone is facing. ... 2 Enable Auto rotate. ... 3 Allow home screen rotation. ... 4 Check rotate settings in the app. ... 5 Calibrate phone’s sensors. ... 6 Uninstall recent apps. ... 7 Update your smartphone. ...

What happens if I Turn Off the lock orientation?

Note: If you create a Tablet app and turn off the "Lock orientation" option, when you put your Mobile device in portrait orientation, the app would be displayed in portrait layout, but the app would not be responsive to the portrait layout automatically.


1 Answers

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:

  • How to detect Camera Overlay view rotation
  • How to do Orientation Detection even the device has locked orientation
  • Detect iOS device orientation lock
  • Detect iPhone screen orientation
  • Callback method on auto rotation, iOS and iPad
like image 125
Steph Sharp Avatar answered Oct 11 '22 01:10

Steph Sharp