Iva*_*nyi 26 svg android imageview
我用svg-android.jar
从https://github.com/pents90/svg-android
它的做工精细,但只有在日食的仿真器设备.Agrrrr.在真实设备上,它只是imageView
在屏幕上清空.这是我的代码:
SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.test);
Drawable drawable = svg.createPictureDrawable();
imgView.setImageDrawable(drawable);
Run Code Online (Sandbox Code Playgroud)
有什么建议吗?
Pau*_*eau 46
在默认情况下打开硬件渲染的较新设备上,您需要明确打开软件渲染.
imgView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Run Code Online (Sandbox Code Playgroud)
我怀疑这可能是你的问题.