简体   繁体   English

如何删除抽屉碎片图标

[英]how to remove icon for drawer fragment

I have used actionBar.setDisplayHomeAsUpEnabled(false); 我用过actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setHomeButtonEnabled(false); actionBar.setHomeButtonEnabled(假); to remove the drawer icon. 删除抽屉图标。 It worked but it seems the icon still occupies the space as before. 它起作用了,但该图标似乎仍然像以前一样占据了空间。 Also, there remains a small transparent button that can be used to open the drawer. 此外,还有一个小的透明按钮可用于打开抽屉。 Can I remove the icon "completely"? 我可以完全删除图标吗? Or what's the exact width the icon will occupy so that I can add same margin at right. 或者图标将占据的确切宽度是多少,以便我可以在右侧添加相同的边距。

First set setDrawerIndicatorEnabled(false) , this will revert to the android.R.attr.homeAsUpIndicator drawable provided from the theme. 首先设置setDrawerIndicatorEnabled(false) ,这将还原为主题提供的android.R.attr.homeAsUpIndicator可绘制对象。 Then calling actionBar.setDisplayHomeAsUpEnabled(false) and actionBar.setHomeButtonEnabled(false); 然后调用actionBar.setDisplayHomeAsUpEnabled(false)actionBar.setHomeButtonEnabled(false); will hide the indicator. 将隐藏指示器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM