nativescript-floatingactionbutton icon indicating copy to clipboard operation
nativescript-floatingactionbutton copied to clipboard

How to use svg images

Open vikasacharya16 opened this issue 5 years ago • 2 comments

Is there any way to use SVG images instead of png and icons.

vikasacharya16 avatar Jan 20 '20 10:01 vikasacharya16

I don't believe the native Android widget supports SVGs by default. So the usage of the native widget would need to be extended/customized to add support for SVG as the icons of the FAB.

Quick look at the docs: https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton.html#setImageDrawable(android.graphics.drawable.Drawable) looks like a Drawable is accepted and android has the VectorDrawable which extends Drawable so it might be possible to actually pass an instance of VectorDrawable to the method inside the plugin.

I'll mark this as an enhancement because it will require checking for SVG and then creating a VectorDrawable from the resource and then passing to the method.

bradmartin avatar Jan 20 '20 14:01 bradmartin

@vick16ach Covert svg to font (with icomoon for example)

standevo avatar May 31 '20 14:05 standevo