5

让UIImageView显示Gif图

 2 years ago
source link: https://www.devashen.com/blog/2016/04/14/gifimageview/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

让UIImageView显示Gif图

Apr 14th, 2016 1:57 pm | 评论

 各位同学们,这次给大家分享一个小工具,可以解决你在开发过程中,需要显示Gif图片的需求;由于太过于简单,我这里就不多说了;有需要的同学,请前往https://github.com/ashen-zhao/asGifImageView进行下载,不需要的同学也可以去Star,留着以后使用,最后,记得关注我哦,哈哈😄;

接下来,简单写一下如何使用该工具

啊神gifUIImageView

功能说明:

这是一个UIImageView的分类,可以让UIImageView支持显示本地Gif以及网络Gif图片。

1.导入分类头文件 #import "UIImageView+ASGif.h"
2.调用
 a.显示本地gif图片
[self.gifImgV showGifImageWithData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"abc" ofType:@"gif"]]];
 b.显示网络gif图片
[self.gifImgV showGifImageWithURL:[NSURL URLWithString:@"http://ww1.sinaimg.cn/large/85cccab3gw1etdi67ue4eg208q064n50.gif"]];

Posted by Ashen

Apr 14th, 2016 1:57 pm

iOS

« iOS之接地气的移动支付 二维码扫描识别 »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK