去掉头部标题栏以下几个方法
在AcdroidMainfest.xml中
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"
>
添加Theme属性,设置为NoTitleBar即可。
方法二:
public void onCreate(BundlesavedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
要写在setContentView(R.layoutmain)前面,
每个activity页面代码中都加上这一句就可以了。
方法三:
res/values/styles
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
改为:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
或者
<!-- 下面两行去掉标题显示 -->
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>