您的位置:首页 > 移动开发 > Android开发

android studio怎样隐藏标题栏

2016-07-22 19:57 309 查看
同时隐藏标题栏和通知栏

//方法-:在清单文件中

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>

//方法二:在activity的onCreate方法写入以下代码:

this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏


隐藏标题栏

//方法一:在清单文件中

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.NoTitleBar"> //去掉标题栏
....

//方法二:在activity的onCreate方法写入以下代码:

this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android studio 隐藏