Remove Icon but have HomeAsUp in ActionBar

前端 未结 8 1391
遥遥无期
遥遥无期 2020-12-25 12:16

I what my actionbar to have a title and homeAsUp but not the logo or icon.

like this:

8条回答
  •  Happy的楠姐
    2020-12-25 12:32

    To hide the icon as well try using setIcon(null)

    actionBar = getSupportActionBar();
    actionBar.setTitle("My Profile");
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setIcon(null);
    actionBar.setHomeButtonEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowHomeEnabled(true);
    actionBar.setDisplayShowTitleEnabled(true);
    

提交回复
热议问题