启动横向模式的Andr​​oid应用 [英] Launching android app in Landscape mode

查看:144
本文介绍了启动横向模式的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只希望在人像模式中显示我的应用程序。一世
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);),只要应用在人像模式下启动,然后该应用程序正在运行时,它改变为横向。
问题是,如果我启动在风景模式下的应用程序,它会显示一秒钟闪屏,然后进入全黑并再次显示开机画面。这永远不断回事,从来没有进入到下一个屏幕。
在解决此问题的任何帮助是非常AP preciated。
谢谢。

I want my app to be displayed only in Portrait mode. I setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);) as long as the app is launched in Portrait mode and then change it to landscape when the app is running. The issue is, if I launch the app in Landscape mode, it displays the Splash Screen for a second and then goes all black and again displays the Splash Screen. this keeps going on forever and never proceeds to the next screen. any help on resolving this issue is much appreciated. thanks.

推荐答案

您可以在清单上的活动

<activity android:name=".MainActivity" android:screenOrientation="portrait" />

这篇关于启动横向模式的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆