1.继承app.Activity的Activity去除标题栏
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE);//去除标题栏 setContentView(R.layout.activity_main); }
2.继承v7.app.AppCompatActivity的Activity去除标题栏
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().hide();//去除标题栏 }