I want my react native app to support only portrait view . I have tried updating the android manifest but it does not seems to be working . When I disable the lock orientation mode on my device , my app turns into landscape mode .
I have tried updating the android manifest file using ,
android:screenOrientation="portrait"
But when I turn off the screen orientation lock on my device the app turns into landscape mode . Can anyone suggest a solution please .
2
Answers
For android,
android:screenOrientation="portrait"
should work after you have rebuilt your project after making this change.For iOS, in Info.plist, use
and then rebuild the project.
You need to do it separately for Android and iOs. There’s a library to ReactNative to do it programatically but I assume you need to define it by default.
As remember there’s screenOrientation attribute to portrait in
AndroidManifest.xml
file.