How to set orientation in nativescript

前端 未结 4 444
面向向阳花
面向向阳花 2020-12-15 07:50

Hello I would like to know how to set device orientation in nativescript. Specifically I want the application that I am writing to stay in the same orientation (portrait) a

4条回答
  •  遥遥无期
    2020-12-15 08:11

    The top answer is correct but for some cases, adding only android:screenOrientation does not work.

    I got it working by adding android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation|screenSize" and take note the order, screenOrientation first before the configChanges.

    Actually i've tested it in both android studio and the Nativescript.

提交回复
热议问题