美文网首页
toolbar返回图标修改的几种方法

toolbar返回图标修改的几种方法

作者: 吉凶以情迁 | 来源:发表于2021-10-26 14:14 被阅读0次

        getBinding().toolBar.setNavigationIcon((int) R.drawable.ic_menu_back);
    <style name="ToolbarIconColor"  parent="@style/ThemeOverlay.AppCompat.Light">
        <item name="colorControlNormal">@color/white_no_night</item>
    </style>
      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);
            }

相关文章

网友评论

      本文标题:toolbar返回图标修改的几种方法

      本文链接:https://www.haomeiwen.com/subject/wxtyaltx.html