简体   繁体   English

Android始终处于纵向模式不起作用

[英]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.

相关问题 Android Pick Image始终处于纵向模式? - Android Pick Image Always in Portrait mode? 使用opencv的android纵向模式的问题 - issues in working with android portrait mode with opencv 在Android中以编程方式使用人像和风景模式 - Working with portrait and landscape mode programmatically in android 在Android中始终以反向人像模式设置活动方向 - Set activity orientation always in reverse Portrait mode in android air android应用程序始终以纵向模式启动,而与手持android设备的方式无关(横向/纵向) - air android app always launches in portrait mode irrespective of the way the android device is held ( landscape/portrait) Android应用程式纵向模式 - Android Application portrait mode 将人像旋转到风景时,我要关闭力量,我尝试了android:configChanges =“ keyboard | keyboardHidden”并以人像模式工作吗? - Getting Force Close when rotating portrait to landscape and I tried android:configChanges=“keyboard|keyboardHidden” and working in portrait mode? FragmentTransaction仅在纵向模式下工作 - FragmentTransaction working only in portrait mode 版式权重在纵向模式下不起作用 - Layout weight not working in portrait mode 在Android中将Imageview锁定为纵向模式 - Locking an imageview into portrait mode in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM