1. 程式人生 > >Android隱藏標題欄

Android隱藏標題欄

  1. 繼承自Activity時在setContentView之前呼叫requestWindowFeature(Window.FEATURE_NO_TITLE);
  2. 繼承自AppCompatActivity時setContentView之前呼叫下面任一方法:
getSupportActionBar().hide();
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);

ActivityAppCompatActivity的關係:

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