android 动态加载svg,android 加载外部矢量图SVG
android加载矢量图的方式主要有以下两种:一、Web方式利用WebVIew来浏览SVG二、本地加载,使用ImageView来展示final URL url = new URL("http://localhost:8080/commons/m.svg");HttpURLConnection urlConnection = (HttpURLConnection) url.openConnectio
·
android加载矢量图的方式主要有以下两种:
一、Web方式
利用WebVIew来浏览SVG
二、本地加载,使用ImageView来展示
final URL url = new URL("http://localhost:8080/commons/m.svg");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
InputStream inputStream = urlConnection.getInputStream();
SVG svg = SVGParser. getSVGFromInputStream(inputStream);
Drawable drawable = svg.createPictureDrawable();
本地加载可以借助外部库利用glide(
https://github.com/bumptech/glide/tree/v3.6.0)
更多推荐
所有评论(0)