Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable screen rotation (react-native)?

Is any chance to disable screen rotation (allow only vertical)? I would like to support only portrait view. And need it to work on android and ios.

like image 523
zlFast Avatar asked Feb 26 '16 07:02

zlFast


People also ask

How do I turn off screen rotation 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 apps from rotating in XCode?

Select your project in the project navigator in Xcode and then click “General”, scroll down to “Deployment info” and uncheck the device orientations that you don't want.


1 Answers

Write the below code in manifest file

<activity
   android:screenOrientation="portrait"
   android:configChanges="orientation|screenSize">
</activity>
like image 129
Rathod Vijay Avatar answered Nov 15 '22 14:11

Rathod Vijay