SVG文件渲染的android [英] svg files rendering in android
问题描述
我在Android中写了一个程序来设置不同类型的图像作为我的背景图片,但它不工作与SVG文件。我没有得到任何错误,它没有显示任何图像,我使用SVG文件时获得一个空白屏幕在我的模拟器。任何一个可以建议如何读取并显示在Android中的SVG文件与一些code?或者我应该转换XML code?
I wrote a program in Android for setting different kinds of images as my background image, but it is not working with svg files. I am not getting any errors, it is not displaying any image and I'm getting a blank screen in my emulator when using svg files. Can any one suggest how to read and display svg files in Android with some code? Or should I convert xml code?
推荐答案
查看蜡染。它是用于创建和在Java解析的SVG的文库。这是的Apache XML图形计划的一部分。
Check out Batik. It's a library for creating and parsing SVG in java. It's part of the Apache XML Graphics Project.
事实证明,越来越蜡染工作在Android是不平凡的,有更容易的方法在Android上使用SVG工作。请参阅<一href="http://stackoverflow.com/questions/4517388/svg-processing-under-java-on-android-and-desktop/4644781#4644781">this回答了解更多详情。
As it turns out, getting Batik to work on Android is non-trivial and there are easier ways to work with SVG on Android. See this answer for more detail.
这篇关于SVG文件渲染的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!