从导航抽屉ActionBar中删除应用程序图标不起作用 [英] Remove App Icon from Navigation Drawer ActionBar Does not work
问题描述
我正在开发一个具有设计要求的应用程序,因为该应用程序仅在ActionBar上具有标题,而在App Icon上则没有. 我尝试了从StackOverflow找到的各种解决方案,例如
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 StackOverflow like
getActionBar().setDisplayUseLogoEnabled(false);
getActionBar().setDisplayShowHomeEnabled(false);
getActionBar().setIcon(null);
但是到目前为止,这些方法都无效,甚至我都尝试通过制作透明的ic_launcher图标并将其放入manifest.xml来进行破解/修复,但这会导致App安装图标透明. 请帮助
however none of these worked so far, even i tried to make a hack/fix by making a transparent ic_launcher icon and put it into manifest.xml but it causes the App installation icon make transparent. please help
getActionBar().setDisplayShowHomeEnabled(false);
在4.4 kitkat中可以完美工作,但是在降级版本中显示像这样的后退箭头
works perfectly in 4.4 kitkat , but showing a back arrow in downgraded version like this
我需要这样才能在每台设备上正常工作
and i need it like this to work in every device
推荐答案
无论如何它都非常棘手,但是我解决了它,它在所有设备中都像魅力一样.
Its quite tricky anyhow, but i solved it,and it works like a charm in all devices.
我制作了一个2x2 px的透明图标,并将其添加为
I made a 2x2 px transparant icon and added it as
ActionBar actionBar = getActionBar();
actionBar.setIcon(R.drawable.actionbar_null_icon);
并删除了代码
getActionBar().setDisplayUseLogoEnabled(false);
getActionBar().setDisplayShowHomeEnabled(false);
感谢nDroidDev的支持
thanks to nDroidDev for suport
这篇关于从导航抽屉ActionBar中删除应用程序图标不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!