SVGKit使用

2017-09-19  本文已影响387人  ElevenXu

SVGKit导入

目标文件.png

前往上层文件夹 选择 Debug-universal / Release-universal 中的 libSVGKit-iOS.2.x.x.a文件 和 usr文件夹,拖入到你的项目中(如果想要 Debug文件,编译时需要在 Xcode-Edit Scheme 中选择 Debug;如果想要 Release文件,需要在 Xcode-Edit Scheme 中选择 Release)

目标文件.png 目标文件.png 文件添加.png

恭喜你 导入成功 可以使用了

SVGKit使用

 SVGKImage* newImage = [SVGKImage imageNamed:@"myImage.svg"];
 SVGKImageView* imageView = [[SVGKFastImageView alloc] initWithSVGKImage:newImage];
 [self.view addSubview:imageView];

运行报错了 找了好久不知什么原因

报错信息.png

调试了一下 发现是断言,但是并不知道为什么
于是我怀疑是我的svg资源文件有问题,到demo里弄了一个.svg格式的图片资源,发现成功了.

最后放张效果图和链接

效果图.png

SVGKit github地址 https://github.com/SVGKit/SVGKit
使用说明 http://t-machine.org/index.php/2012/12/31/svgkit-2013-usage/

其他的一些用法后面有空 后续更新

上一篇 下一篇

猜你喜欢

热点阅读