Question: I’ve added a SVG file with transparent b...
# android-studio
b
Question: I’ve added a SVG file with transparent background in Android Studio but the transparent replaced with yellow color? Any idea how can I add a SVG file with transparent background?
🧵 1
c
Hmm that seems like a bug. Does that image have that yellow color in it?
b
the original image, does not have yellow color, but after importing it to Android studio I can see the value of yellow color in the xml.
g
can you check inside the vector asset file if there is an
android:fillColor
or
android:tint
that is this tone of yellow? and if so, maybe replace it with transparent? (something like
#00000000
) and see if it works? SVG conversion to vector asset is not perfect, and depending on how the original image was constructed, AS may not have been able to translate everything perfectly and you found a bug or non-supported case
It's ok to edit the final result to perform these small corrections if you are able to
b
@Guilherme Cordeiro really appreciate your participation.
Honestly, this is what I’ve done just to move on. I changed the color by typing from yellow to white.
I am supersized, because I used the same SVG file 3 months back and all was perfect. Maybe there is a bug in the new patches.
c
Can you share the SVG here?
b
Sorry @Chris Sinco [G], I don’t check Slack regularly. Please see attached.
c
Thanks for the file! So there is actually a layer in the SVG with yellow… I would suggest stripping out that group or removing the fill color since you don’t need it. The SVG conversion in Studio is not perfect and not identical to web since vector drawable only supports a certain subset of operations from SVG.
I just tried it and the SVG looks better now
b
Thanks a lot for your explanation, you just encouraged me to understand more about SVG rendering. I believe it’s a huge/interesting topic to study.
👍 1