Remove App Icon from Navigation Drawer ActionBar Does not work

后端 未结 2 1048
时光取名叫无心
时光取名叫无心 2021-01-07 10:42

I am working on an App which has design requirement to be built as it should only have the Title on the ActionBar and not the App Icon. i tried various solutions found from

2条回答
  •  情深已故
    2021-01-07 11:40

    Its quite tricky anyhow, but i solved it,and it works like a charm in all devices.

    I made a 2x2 px transparant icon and added it as

    ActionBar actionBar = getActionBar();
    actionBar.setIcon(R.drawable.actionbar_null_icon);
    

    and removed the code

    getActionBar().setDisplayUseLogoEnabled(false);
    getActionBar().setDisplayShowHomeEnabled(false);
    

    thanks to nDroidDev for suport

提交回复
热议问题