How to remove the title when launching android app?

前端 未结 12 1979
死守一世寂寞
死守一世寂寞 2021-02-06 10:43

I already remove the title in onCreate() method.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(         


        
12条回答
  •  情书的邮戳
    2021-02-06 11:32

    Do this in your onCreate() method.

    //Remove title bar

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    

    //Remove notification bar

    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    this refers to the Activity.

    ===========

    EDIT:

    if you are using ActionBarSherLock

    final ActionBar bar = getSupportActionBar();
    bar.setDisplayShowTitleEnabled(false);
    

提交回复
热议问题