How to disable landscape mode in React Native Android dev mode?
As @morenoh149 stated above the property name and value to do this is android:screenOrientation="portrait". React Native generates a file called AndroidManifest.xml in your project directory under the Android folder. Within that xml file under the tag manifest/application/activity you would add the line android:screenOrientation="portrait"
An example is shown below
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
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>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Harry Moreno's comment is correct. Add it to android/app/src/main/AndroidManifest.xml in the 'activity' section. Also change
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
to
android:configChanges="keyboard|keyboardHidden|screenSize"
removing orientation so it doesn't conflict with the new line added,
android:screenOrientation="portrait"
http://developer.android.com/guide/topics/manifest/activity-element.html
add android:screenOrientation="portrait"
to your activity xml
Add android:screenOrientation="portrait"
to the activity
section in android/app/src/main/AndroidManifest.xml
file, so that it end up looking like this:
<activity
android:name=".Activity"
android:label="Activity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
</activity>
There are several different values for the android:screenOrientation
property; for a comprehensive list take a look at the following: https://developer.android.com/guide/topics/manifest/activity-element.html