react-native-orientation-locker icon indicating copy to clipboard operation
react-native-orientation-locker copied to clipboard

proplem dont lock orientation

Open misaku opened this issue 5 years ago • 2 comments

i have one problem only in device, when i locked landscap the application change to landscap but comeback to portrait and dont lock. if i try in emulator is ok. i used android device. any idea?

misaku avatar Feb 10 '21 04:02 misaku

Same here

452MJ avatar Jun 05 '23 08:06 452MJ

I found an solution to solve this problem. Try to modify function lockToPortrait() in java/org/wonday/orientation/OrientationModule.java

    @ReactMethod
    public void lockToPortrait() {
        //...
-        activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
+        activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
        //...
        
    }

452MJ avatar Jun 06 '23 01:06 452MJ