Remove title in Toolbar in appcompat-v7

前端 未结 18 1602
孤街浪徒
孤街浪徒 2020-12-07 09:52

The documentation of Toolbar says

If an app uses a logo image it should strongly consider omitting a title and subtitle.

18条回答
  •  庸人自扰
    2020-12-07 10:33

    if your using default toolbar then you can add this line of code

    Objects.requireNonNull(getSupportActionBar()).setDisplayShowTitleEnabled(false);
    

提交回复
热议问题