【发布时间】:2014-02-25 23:42:25
【问题描述】:
我已经将一个psd文件转换为svg,它在浏览器上运行良好,但在android原生应用程序上不可用,我该怎么做?
ImageView imageView = (ImageView)findViewById(R.id.img1);
imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
//Parse the SVG file from the resource
SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android);
//Get a drawable from the parsed SVG and apply to ImageView
imageView.setImageDrawable(svg.createPictureDrawable());
这是我用来显示 svg 图像的代码。当我使用简单的 svg 图像时它可以工作,但它不适用于使用 illustrator 转换的 svg 图像。我该怎么办?
【问题讨论】: