步骤:为Activity设置一个默认的屏幕方向方法如下:
在AndroidManifest.xml中找到该Activity 添加代码:
android:name=".ActivityName"
android:screenOrientation="landscape"
>
设置Activity的默认方向为“横向”
此处的screenOrientation有如下选项:
==================================================================
= unspecified 默认值,由系统判断状态自动切换
= landscape 横屏
= portrait 竖屏
=user 用户当前设置的orientation值
= behind 下一个要显示的Activity的orientation值
= sensor 使用传感器 传感器的方向
= nosensor 不使用传感器 基本等同于unspecified
在AndroidManifest.xml中找到该Activity 添加代码:
android:name=".ActivityName"
android:screenOrientation="landscape"
>
设置Activity的默认方向为“横向”
此处的screenOrientation有如下选项:
==================================================================
= unspecified 默认值,由系统判断状态自动切换
= landscape 横屏
= portrait 竖屏
=user 用户当前设置的orientation值
= behind 下一个要显示的Activity的orientation值
= sensor 使用传感器 传感器的方向
= nosensor 不使用传感器 基本等同于unspecified