Remove title in Toolbar in appcompat-v7

前端 未结 18 1604
孤街浪徒
孤街浪徒 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:35

    Try this...

     @Override
     protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_landing_page); 
    
        .....
    
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_landing_page);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
    
        .....
    
     }
    

提交回复
热议问题