How do I disable orientation change on Android?

后端 未结 12 1161
一向
一向 2020-11-22 02:45

I have an application that I just would like to use in portrait mode, so I have defined android:screenOrientation=\"portrait\" in the manifest XML. This works OK for the HTC

12条回答
  •  粉色の甜心
    2020-11-22 02:50

    Please note, none of the methods seems to work now!

    In Android Studio 1 one simple way is to add android:screenOrientation="nosensor".

    This effectively locks the screen orientation.

提交回复
热议问题