[英]Android always in portrait mode not working
I want to run my application always in portrait mode. 我想始终以纵向模式运行我的应用程序。 I searched and found the code below, then I added to manifest file. 我搜索并找到下面的代码,然后将其添加到清单文件中。
android:configChanges="orientation"
android:screenOrientation="portrait"
but my application still chancing orientation when I press CRTL+F12 on AVD. 但是当我在AVD上按CRTL + F12时,我的应用程序仍会切换方向。 How can I force my application always run in portrait mode? 如何强制我的应用程序始终以纵向模式运行?
Ps: I tried the code reverse. 附:我尝试将代码反向。 (Second line first then first line) (第二行,然后第一行)
Did you add that in the activity element, not the application element? 您是否在活动元素中而不是在应用程序元素中添加了它?
<activity
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden" >
</activity>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.