简书链接:toolbar返回图标修改的几种方法
文章字数:1,阅读全文大约需要1分钟

1
2

getBinding().toolBar.setNavigationIcon((int) R.drawable.ic_menu_back);
1
2
3
<style name="ToolbarIconColor"  parent="@style/ThemeOverlay.AppCompat.Light">
<item name="colorControlNormal">@color/white_no_night</item>
</style>
1
2
3
4
5
6
7
Drawable upArrow = ContextCompat.getDrawable(this, R.drawable.abc_ic_ab_back_material);
if(upArrow != null) {
upArrow.setColorFilter(ContextCompat.getColor(this, R.color.white), PorterDuff.Mode.SRC_ATOP);
if(getSupportActionBar() != null) {
getSupportActionBar().setHomeAsUpIndicator(upArrow);
}