去掉app的标题
方法一:
当继承自Activity
或ActionBarActivity
时,在setContentView(...)
方法前调用
requestWindowFeature(Window.FEATURE_NO_TITLE);
当继承自AppCompatActivity
时,就无效了,必须采用方法五。
方法二:在activity节点下设置
theme:android:theme=”@android:style/Theme.Black.NoTitleBar” 黑色背景
android:theme=”@android:style/Theme.Light.NoTitleBar” 白色背景
“android:Theme.Holo.Light.NoActionBar”白底(包含alertDialog)
方法三:所有的value目录下的style文件修改为(不加@也可以)
style name=”AppBaseTheme” parent=”@android:style/Theme.Light.NoTitleBar”
方法四:application节点下的theme替换为:
android:theme=”@android:style/Theme.Black.NoTitleBar”
android:theme=”@android:style/Theme.Light.NoTitleBar”
android:theme=”@android:style/Theme.NoTitleBar”
方法四:
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:windowNoTitle">true</item>
</style>
方法五:
//隐藏标题栏
ActionBar actionBar = getSupportActionBar();
//ActionBar actionBar = getActionBar();
actionBar.hide();