vincentzhou
vincentzhou

Reputation: 720

how to remove icon for drawer fragment

I have used actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setHomeButtonEnabled(false); 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.

Upvotes: 0

Views: 800

Answers (1)

Nikola Despotoski
Nikola Despotoski

Reputation: 50588

First set setDrawerIndicatorEnabled(false), this will revert to the android.R.attr.homeAsUpIndicator drawable provided from the theme. Then calling actionBar.setDisplayHomeAsUpEnabled(false) and actionBar.setHomeButtonEnabled(false); will hide the indicator.

Upvotes: 1

Related Questions