Saturday, September 13, 2014

Android SVG

http://stackoverflow.com/questions/25006511/how-do-i-render-an-svg-in-an-android-app

I managed to display an SVG using a WebView, since that is more than capable of rendering an SVG:
webView.loadUrl("file:///android_res/drawable/file.svg"); // point it to the SVG
webView.setBackgroundColor(0x00000000); // set the background to transparent
This makes it render much like a transparent PNG would in an ImageView. The only caveat is that the SVGmust use the viewBox attribute and not use the height or width attributes, to ensure it resizes properly.

http://www.codeproject.com/Articles/130791/Android-ImageView-with-SVG-Support

http://stackoverflow.com/questions/18356098/having-issue-on-real-device-using-vector-image-in-android-svg-android

No comments:

Post a Comment