How to use selector to tint ImageView?

前端 未结 6 1141
别跟我提以往
别跟我提以往 2020-11-30 00:58

I want to tint my tabhost\'s icons using XML, instead of doing it programmatically (I wasn\'t able to do that anyway)...

I found this thread on SO: Android imagevie

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 01:41

    With support library 22.1 we can use DrawableCompat to tint drawable, API level 4+

    DrawableCompat.wrap(Drawable) and setTint(), setTintList(), and setTintMode() will just work: no need to create and maintain separate drawables only to support multiple colors!

提交回复
热议问题