sungl sungl - 4 months ago 97
Android Question

How to disable landscape mode in React Native Android dev mode?

I am new to android environment. I know iOS can be done in Xcode to disable device orientation. How can I disable landscape mode or any orientation mode in React Native Android?

Thanks.

Answer

add this to your xml file inside the activity

example:

<activity
    android:name=".Activity"
    android:label="Activity"
    android:screenOrientation="nosensor"
    android:configChanges="keyboardHidden|orientation|screenSize">
</activity>
Comments