1)第一种在activity的onCreate中加入:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//隐藏标题的头部 要放在加载布局文件的上边
requestWindowFeature(Window.FEATURE_NO_TITLE);setContentView(R.layout.activity_add_client_go_and_back);
}
2)第二种方法是在清单文件AndroidManifest.xml中的activity的的属性中加入:
android:theme="@android:style/Theme.Light.NoTitleBar"
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar" >
</application>
附:android的一些Theme设置
android:theme="@android:style/Theme.Black" //背景黑色-有标题-非全屏
android:theme="@android:style/Theme.Black.NoTitleBar" //背景黑色-无标题-非全屏
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" //背景黑色-无标题-全屏显示
android:theme="@android:style/Theme.Dialog" //对话框显示
android:theme="@android:style/Theme.InputMethod"
android:theme="@android:style/Theme.Light" //背景白色-有标题-非全屏
android:theme="@android:style/Theme.Light.NoTitleBar" //背景白色-无标题-非全屏
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" //背景白色-无标题-全屏显示
android:theme="@android:style/Theme.Light.Panel"
android:theme="@android:style/Theme.Light.WallpaperSettings" //背景透明
android:theme="@android:style/Theme.NoDisplay"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" //半透明、无标题栏、全屏
android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"