本文介绍了如何在没有 uiwebview 的情况下在 iphone 中渲染 SVG 图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不使用 UIWebView 的情况下在 iPhone 中呈现 SVG 图像.我该怎么做?

I want to render SVG images in iPhone without using a UIWebView. How can I do that?

我已经检查了这两个链接:

I have checked these 2 links:

http://www.splashdust.net/2010/09/svgquartzrenderer-a-basic-iphone-sdk-compatible-svg-renderer/https://github.com/splashdust/SVGQuartzRenderer

Github 上的上述项目显示 102 个错误,显示 UIKit 框架缺失和其他错误,我也无法添加该框架.我认为该应用程序适用于 MacOS 而不是 iOS.

The above project on Github shows 102 errors showing UIKit framework missing and others and I are also not able to add that framework.I think the application is for MacOS not for iOS.

http://maniacdev.com/2011/05/open-source-library-to-render-svg-graphics-as-core-animation-layers/
https://github.com/mattrajca/SVGKit

上述网址上的项目在我构建项目时显示错误.

The project on the above url shows the error when i build the project.

Target 指定产品类型com.apple.product-type.framework",但iPhoneOS"平台没有此类产品类型.

Target specifies product type 'com.apple.product-type.framework', but there's no such product type for the 'iPhoneOS' platform.

有人知道怎么解决吗?或者我可以使用的其他有用的工作示例?我想在 iPhone 上渲染 SVG.

Does anyone know how to solve that? Or other useful working examples that I can use for that? I want to render SVG's on iPhone.

更新:我已经通过阅读说明使 SVGKit 正常工作.但是当我试图让我从 Github 下载的项目工作时(https://github.com/splashdust/SVGQuartzRenderer) 我收到以下错误:

UPDATE: I have got working SVGKit working by reading instructions. But when I tried to make project working which iI downloaded from Github (https://github.com/splashdust/SVGQuartzRenderer) I got following errors:

1) UIKit/UIKit.h:没有这样的文件或目录(我无法使用添加现有框架添加它)
2) Libxml/tree.h:没有这样的文件或目录
3) 'xmlParserCtxtPtr' 之前的预期说明符限定符列表.有谁知道如何解决它并使其工作?

1) UIKit/UIKit.h: No such file or directory (I am not able to add it using add existing framework)
2) Libxml/tree.h: No such file or directory
3) Expected specifier-qualifier-listbefore 'xmlParserCtxtPtr'.Does anyone know that how to resolve it and make it work?

推荐答案

Jason Morrissey,非常优秀的 Alien Blue 应用程序的作者,商店里最好的 iOS Reddit 客户端(你能说我是粉丝吗?我是也是一个 beta 测试者.)最近提出了他的 SVGKit 框架,它将 SVG 图像渲染为核心动画层.我没用过,但我知道它存在.

Jason Morrissey, author of the extremely excellent Alien Blue app, the best iOS Reddit client on the store (can you tell I'm a fan? I'm also a beta tester.) recently put up his SVGKit framework, which renders SVG images as Core Animation layers. I haven't used it, but I know it exists.

然后,看……如果你只是在引入其他人的课程时遇到很多错误,我强烈怀疑你没有遵循他们的如何使用"说明.他们主要会告诉您需要哪些框架以及它们支持哪些平台.每次我尝试使用这样的东西并进行编译时,我都会回过头来发现我错过了一些安装说明步骤.

And then, look... if you're just getting lots of errors when you bring in other people's classes, my strong suspicion is that you're not following their "how to use" instructions. They'll mostly tell you what frameworks are required and what platforms they support. Every time I've tried to use something like this and had a compilation bloodbath, I've gone back and found some installation instruction step I missed.

这篇关于如何在没有 uiwebview 的情况下在 iphone 中渲染 SVG 图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:19
查看更多