android - 在 Android 中以编程方式删除色调颜色

标签 android

<分区>

我想以编程方式删除(重置)已在 XML 布局中设置的 ImageView Tint color

最佳答案

我认为如果上述方法不起作用,您可以尝试以编程方式再次将图像添加到 imageview,同时以编程方式再次添加它时不要为其设置 tintcolor,它会被原始颜色膨胀

    myImgView.setImageResource(R.drawable.yourDrwable);

或者我认为这对您有用。

    imageview.setColorFilter(null)

    imageView.clearColorFilter()

    imageView.drawable.setTintList(null)

    ImageViewCompat.setImageTintList(imageView, null);

根据评论更新

关于android - 在 Android 中以编程方式删除色调颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45205042/

相关文章:

android - 如何访问 Google Maps android API v2 后台的位置更改?

android - 在哪里提交有关 Android EMM API 的错误报告?

java - 将字节码转换为 dex 时出错

android - 检查 ANDROID 中的互联网连接

android - MotionEvent getActionIndex() 总是 ACTION_DOWN

android - 无法覆盖使用相同 URI 拍摄的照片

android - 将 onTouch ACTION_MOVE 限制为一个 View

android - 在 2.2 版本的 android webview 中加载 https 时出现白屏

android - 如何将arraylist存储在ormlite数据库中

java - 更快地启动对象并更快地更新 Textview