lock-device-orientation.mo
- A running React Native app, preferably started with the generator
:warning: Do not forget to rebuild your app
:warning: Do not lock the screen rotation on react-native-camera or other native modules which needs screen rotation
We need to lock all the app pages, to do so import react-native-orientation in our top component:
import Orientation from 'react-native-orientation
Add those lines to lock the orientation:
componentWillMount () {
Orientation.lockToPortrait()
}
- Refresh your app, and try to rotate your screen
Last modified 5yr ago