[英]It is possible to known when the screen orientation is changed but with portrait mode forced on manifest?
[英]Screen orientation forced to portrait, but still, the activities will rotate to landscape when tilted!! How to force portrait mode?
我已经在stackoverflow上搜索了此内容,但没有找到我想要的任何解决方案。
在清单文件中,我为每个活动编写了以下行
android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden"
但仍然,所有活动都会在倾斜手机时旋转到横向。
我该如何解决这个问题?
“从前,我是C / C ++,iOS,Java,Javascript,C#的自信开发人员,但感谢android!现在我什至无法与镜子并驾齐驱!”
也许这会有所帮助
在您的主要活动之后的清单文件中,在下面的行中编写
android:screenOrientation="portrait"
或在setContentView()之后的代码中添加此行。
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.