How to lock Orientation for a particular screen in ios in react native?

I want to lock the orientation of my camera screen.

<Stack.Screen name="Camera" component={Camera} options={{ headerShown:false,orientation:'landscape'}}/>

This works fine in android but does not work on ios devices. Is there a way to solve this problem?


  • You can use below plugin for that

    Set up plugin and configure as mention in their doc and in react native side add below code which you want to Lock Screen portrait or landscape

    import Orientation from 'react-native-orientation-locker';
       Orientation.lockToPortrait(); //this will lock the view to Portrait
       Orientation.lockToLandscape(); //this will lock the view to Landscape


    One more plugin is there you can set screen wise orientation In my one of the project this is also working . Hope your issue will be resolve on this.