Android的,只有横向方向? [英] Android, landscape only orientation?
问题描述
我怎样才能使它所以屏幕方向始终是景观?
How can I make it so the screen orientation is always landscape?
我需要的东西添加到的manifest.xml
?
推荐答案
将此安卓screenOrientation =景观
您<活性GT ;
在清单中为您想在景观的具体行动标签
Add this android:screenOrientation="landscape"
to your <activity>
tag in the manifest for the specific activity that you want to be in landscape.
编辑:
要切换从活动的方向
code,叫 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
其它参数可在Android文档中找到的<一个href="http://developer.android.com/reference/android/content/pm/ActivityInfo.html">ActivityInfo.
To toggle the orientation from the Activity
code, call setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
other parameters can be found in the Android docs for ActivityInfo.
这篇关于Android的,只有横向方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!