本文介绍了使用矢量图像中的android上真实的设备有问题。 SVG-机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 SVG-的android.jar https://github.com/pents90/svg-android 在它的做工精细,但只有在日食的仿真器设备。 Agrrrr。在真实设备上,它只是空的的ImageView 在屏幕上。这里是我的code:

I use svg-android.jar from https://github.com/pents90/svg-android at its work fine but only on emulator devices in eclipse. Agrrrr. On real devices it just empty imageView on screen.here is my code:

SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.test);
Drawable drawable = svg.createPictureDrawable();
imgView.setImageDrawable(drawable);

任何建议?

推荐答案

在具有硬件呈现较新的设备默认打开的,你需要明确启用软件渲染。

On newer devices that have hardware rendering turned on by default, you need to explicitly turn on software rendering.

imgView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

我怀疑这可能是你的问题。

I suspect this is probably your problem.

这篇关于使用矢量图像中的android上真实的设备有问题。 SVG-机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:16
查看更多