1、在主题中设置无标题、全屏java
(一):直接设置主题:android
android:theme=
"@android:style/Theme.NoTitleBar.Fullscreen"
// 不显示应用程序标题栏,并全屏
android:theme=
"Theme.Light.NoTitleBar.Fullscreen"
// 白色背景,无标题栏,全屏
android:theme=
"Theme.Black.NoTitleBar.Fullscreen"
// 黑色背景,无标题栏,全屏
(二):在须要的Activity中添加对应主题:code
android:theme=
"@style/Theme.NoTitle_FullScree"
blog
(三):在Theme中直接添加属性:ci
一、进入项目的mainfest文件中,查看 :get
android:theme="@style/AppTheme" >
二、进入主题:string
<style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> </style>
三、再进入parent,在里面添加<Item name="android:windowNoTitle">true</item>it
<style name="AppBaseTheme" parent="android:Theme.Holo.Light"> <item name="android:windowNoTitle">true</item> </style>
到此,运行项目则没有标题显示!io
2、代码中实现全屏不标题:class
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); //隐藏状态栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
//隐藏标题栏,放在setCountView()前