requestWindowFeature(Window.FEATURE_NO_TITLE); // 去掉标题栏
< application android:icon = " @drawable/icon "
android:label = " @string/app_name "
android:theme ="@android:style/Theme.NoTitleBar" >
能够看出,这样写的话,整个应用都会去掉标题栏,若是只想去掉某一个Activity的标题栏的话,能够把这个属性加到activity标签里面html
例如:android
<? xml version="1.0" encoding="UTF-8" ?>
< resources >
< style name ="notitle" >
< item name ="android:windowNoTitle" > true </ item >
</ style >
</ resources >
这样,咱们就自定义了一个style,就至关于一个主题,而后在AndroidManifest.xml文件中定义app
< application android:icon ="@drawable/icon"
android:label ="@string/app_name"
android:theme ="@style/notitle" >
这样也能够达到去掉标题栏的效果ide
第一种,有的时候咱们会看到,会先出现标题栏,而后再消失,由于咱们只是在activity的oncreate方法中定义的,第二种相对第一种比较好一些,不会出现这种状况,第三种我我的感受最好,这样把功能分开,便于维护和扩展post
第一种spa
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
第二种code
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
第三种orm
application android:icon ="@drawable/icon"
android:label ="@string/app_name"
android:theme ="@style/fullscreem"