问题描述
我正在尝试在我的iOS应用程序中显示一个svg文件.
I'm trying to display a svg file in my iOS application.
svg文件是通过REST API给我的.因此,我最终从API得到了这样的答案:
The svg file is given to me by a REST API. So I end up with an answer like this from the API :
{
"response": {
"data": {
"var2": "svgCodeXML"
}, "status": "ok"
}
}
当前,我正在Web视图中显示它,并且正在显示.
Currently I'm displaying it in a web view and it's displaying.
我想直接在我的iOS应用中显示svg,而没有网络视图.
I'd like to display the svg directly in my iOS app, without a web view.
我一直在寻找SVGKit库,但是还没有找到一种方法.
I've been looking at the SVGKit library but I haven't found a way to do it.
有人知道如何实现这个目的吗?
Do anybody know how to achieve this purpose?
非常感谢您.
推荐答案
您可以尝试使用SVG套件.您可以在此处找到代码和示例: https://github.com/SVGKit/SVGKit
You can try using SVG kit. You can find the code and examples here: https://github.com/SVGKit/SVGKit
这篇关于iOS:从JSON显示svg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!