我希望我的Android应用程序将仅在纵向模式下运行? 我该怎么办呢?
I want my android application to be only run in portrait mode? How can I do that?
在清单中,设置此为您的所有活动:
In the manifest, set this for all your activities:
<activity android:name=".YourActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
让我来解释一下:
使用机器人:configChanges =定向
你告诉Android的,你会负责的取向变化
机器人:screenOrientation =肖像
设置默认的方向模式
With android:configChanges="orientation"
you tell Android that you will be responsible of the changes of orientation.
android:screenOrientation="portrait"
you set the default orientation mode.