I would like to support only portrait view. How can I make a React Native app not to autorotate? I tried searching documentation and Github issues, but I didn\'t find anythi
use this for ios ipad orientaion issue want to change in plist file https://www.reddit.com/r/reactnative/comments/7vkrfp/disabling_screen_rotate_in_react_native_both/
IOS:
<key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> </array>
For Android: In your manifest file put:
xmlns:tools="http://schemas.android.com/tools"
Then inside the application tag put:
tools:ignore="LockedOrientationActivity"
And then in all activity set:
android:screenOrientation="portrait"
Android :
Go to the Androidmenifest.xml file and add one line : android:screenOrientation="portrait"
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
IOS :
Simple you have to uncheck rotation mode from your XCODE
enter image description here
ref from ANKIT-DETROJ answer.
React Native app is pretty much just a normal iOS application, so you can do it in exactly the same way as you do for all other apps. Simply uncheck (in XCode) the "Landscape Left" and "Landscape Right" as allowed Device Orientations in the General application properties:
For iOS, Jarek's answer is great.
For Android, you need to edit the AndroidManifest.xml file. Add the following line to each activity that you want to lock into portrait mode:
android:screenOrientation="portrait"
So, a full example might look like this:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
See full list of available screenOrientation properties in the docs, here: https://developer.android.com/guide/topics/manifest/activity-element.html