programmatically update android Vector Drawable

后端 未结 3 1698
悲&欢浪女
悲&欢浪女 2020-12-03 16:39

I have a VectorDrawable consists of 9 rectangles. This is defined as an XML in the the drawables folder. I have this set as the background for an ImageView that I have dec

3条回答
  •  误落风尘
    2020-12-03 17:24

    Try this library https://github.com/devendroid/VectorChildFinder

    val vector = VectorChildFinder(context, R.drawable.drawable_id, imageView)
    vector.findPathByName("path_name").fillColor = Color.RED
    
    
    
        
    
    

提交回复
热议问题