Android隐藏标题栏

  1. 继承自Activity时在setContentView之前调用
requestWindowFeature(Window.FEATURE_NO_TITLE);
  1. 继承自AppCompatActivity时setContentView之前调用下面任一方法:
1. getSupportActionBar().hide();
2. supportRequestWindowFeature(Window.FEATURE_NO_TITLE);

ActivityAppCompatActivity的关系:

AppCompatActivity->FragmentActivity->BaseFragmentActivityApi16->
BaseFragmentActivityApi14->SupportActivity->Activity->
ContextThemeWrapper->ContextWrapper

你可能感兴趣的:(Android基础知识)