How to change colors of a Drawable in Android?

前端 未结 21 1887
野性不改
野性不改 2020-11-22 13:50

I\'m working on an android application, and I have a drawable that I\'m loading up from a source image. On this image, I\'d like to convert all of the white pixels to a dif

21条回答
  •  醉酒成梦
    2020-11-22 14:23

    It works for some simple drawables. I used it on a simple solid color rect shape with rounded corners and needed to change that color with different layouts.

    Try this

    android:backgroundTint="#101010"
    

提交回复
热议问题