Answer the question
In order to leave comments, you need to log in
How to set a reference to the @color/color*** resource in the icon drawable file in android:fillColor?
There is a problem. I created an icon using Vector Asset and would like to change its color, but when using this method android:fillColor="@color/color***" errors start to fly out. How to fix it?
Answer the question
In order to leave comments, you need to log in
Vector icons are rasterized at build time for compatibility purposes, so you won't be able to use resources.
If you need a permanent color, then you have to hardcode it. If you need to change the color of the icon, then you need to use it android:tint
in the markup where the icon is used, or programmatically using setTint ().
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question