我希望我的 Android 应用程序仅在纵向模式下运行?
我怎样才能做到这一点?
在清单中,为您的所有活动进行设置:
<activity android:name=".YourActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
让我解释:
- With
android:configChanges="orientation"
你告诉Android你将负责方向的改变。
-
android:screenOrientation="portrait"
您设置默认方向模式。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)