how to read svg file
can any开发者_StackOverflow中文版 one tell me which classes supports to read & display svg files in android.
Try this
https://launchpad.net/libsvg-android
as found in this other question SVG to Android Shape
AndroidSVG is a third party library and provides classes to render SVG files.
You may also set the width and height of the SVG file.
Following is a sample code snippet to read an SVG File :
val svg = SVG.getFromResource(resources, R.raw.ic_motorcycle_black_24px)
svg.renderToCanvas(canvas)
For full example and working Android application refer Kotlin Android Tutorial - Android Draw SVG to Canvas
精彩评论