Android横竖屏设置:
方法一:onCreate()中
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); //横屏 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //竖屏
方法二:AndroidManifest.xml中
android:screenOrientation="landscape" //横屏
android:screenOrientation="portrait" //竖屏
<activity android:name="com.example.androidtest.activity.MainActivity" android:label="@string/app_name" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/shenyuanqing/article/details/46801855