问题描述
可能重复:结果
<一href=\"http://stackoverflow.com/questions/4277596/android-setting-activity-orientation-by-$c$c\">android由code 制定活动方向
我需要你的帮助的问题。
我有一个图表需要查看的景观让屏幕可以查看全图的。我想将设备设置,查看在横向模式,当用户旋转设备为纵向,图表将停留在横向模式。我只是一个新手,任何人都可以告诉我如何做到这一点。
I got a problem need for your help.I got a chart need to view in LANDSCAPE to let the screen can view full of chart. And i'd like to set the device to view in LANDSCAPE mode, and when user rotate the device to PORTRAIT, the chart will stay in LANDSCAPE mode. I'm just a newbie, could anyone tell me how to achieve that.
感谢您的任何意见
克拉克
推荐答案
请参阅本的。打开你的AndroidManifest.xml,添加此code:
refer to this activity-doc. open your AndroidManifest.xml, add this code:
<activity android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:name="myActivity">
或你的活动类中添加这行
or add this line in your activity class
myActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
这篇关于设置方向为android系统视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!