【Android笔记】入门篇02:全屏设置和禁止横屏竖屏切换

【参考】:Android禁止横屏竖屏切换 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package
="com.qulordy.game.chesswarrior"
android:versionCode
="1"
android:versionName
="1.0" >

<uses-sdk android:minSdkVersion="7" />

<application
android:icon="@drawable/ic_launcher"
android:label
="@string/app_name" >
<activity
android:label="@string/app_name"
android:name
=".ChessWarrior"
android:screenOrientation
="portrait" #禁止屏幕横竖切换,portrait为纵向,landscape为横向
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > #设置无标题栏全屏模式
<intent-filter >
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

【说明】:上面代码中#后面为人为注释,只是为了说明用法。

结果如图:



转载于:https://www.cnblogs.com/QuLory/archive/2011/12/21/android_notes--basic--02--ui_full_screen-and-keep_portrait.html

猜你喜欢

转载自blog.csdn.net/weixin_33928467/article/details/93154338