Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unlockAllOrientations does not work #97

Open
olinations opened this issue Oct 15, 2019 · 1 comment
Open

unlockAllOrientations does not work #97

olinations opened this issue Oct 15, 2019 · 1 comment

Comments

@olinations
Copy link

I created a screen and upon loading I lock it to landscape mode. After that I cannot unlock it, it remains in landscape mode. I can change it to lock in portrait mode after being in landscape mode and that works, but Orientation.unlockAllOrientations() never works.

To test I even created a button to unlock orientation, simply calling Orientation.unlockAllOrientations() when pressed and it does not work. orientation remains locked.

I am using ReactNative 0.59.x

@daveyjones
Copy link

@olinations I ran into the same issue. I'm using Wix React Native Navigation for navigation and I realized that I needed to enable both orientations in the settings. That may not help you but it might help others who run into this issue.

Navigation.events().registerAppLaunchedListener(async () => {
    Navigation.setDefaultOptions({
        ...
        layout: {
            orientation: ["portrait", "landscape"] // <-- Enable both orienations
        },
        ...
    })
    Navigation.setRoot({
        ...
    })
})

mars-lan added a commit to mars-lan/react-native-orientation-locker that referenced this issue Jul 26, 2020
wonday pushed a commit that referenced this issue Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants