比较常用的有两种。
一、在清单文件(manifest.xml)里面实现:
<application android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
二、在代码里实现。
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//去掉标题栏
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
这两种都比较常用和简单。
完。效果自然是顶部的标题栏消失,就不配图了。