[self.imageView sd_setImageWithURL:[NSURL URLWithString:topic.image2]];
NSString *extensionName = topic.image2.pathExtension;
self.gifView.hidden = ![extensionName.lowercaseString isEqualToString:@"gif"];
拿到图片的字符串url,调用pathExtension属性方法获取扩展名,判断是否为gif
网友评论