我正在使用mikepenz抽屉库但我想用我自己的可绘制图标更改默认humburger图标和后退箭头图标。如何更改工具栏中的Humberger图标?
我已经尝试了很多次,但是我无法用我自己的图标更改图标。
任何人都可以帮助我吗?
new DrawerBuilder()
.withActivity(this)
.withTranslucentStatusBar(false)
.withActionBarDrawerToggle(false)
.withToolbar(toolbar)
.addDrawerItems(
//pass your items here
)
.build();
码查看HUMBURGER ICON:
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
result.getActionBarDrawerToggle().setDrawerIndicatorEnabled(true);
以下是我发现很多次的代码,但我想这也是,但没有奏效
Drawable upArrow = getResources().getDrawable(R.drawable.my_drawable);
actionBar.setHomeAsUpIndicator(upArrow);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
,当我搜索我也会知道,如果您将工具栏传递到抽屉构建器中,则无法更改图标,所以任何人都可以告诉我该怎么办?
我试过,但没有奏效 –
好吧,顺便格式化你的问题,以避免downvotes。 – Shaishav