您的位置:首页 > 产品设计 > UI/UE

UIimage的几种加载方式

2016-03-23 11:27 351 查看
根据图片名称加载

UIImage* image = [UIImage
imageNamed:@"banner"];

根据url
加载

NSURL *url =[NSURL
URLWithString:[CommonTool
getImageUrlString:self.imageNameA[i]]];

UIImage* image = [UIImage
imageWithData:[NSData
dataWithContentsOfURL:url]];

UIImageView 直接使用sdwebImage 加载url

@property (weak,
nonatomic) IBOutlet
UIImageView *imageV;

#import <UIImageView+WebCache.h>

[self.imageV
sd_setImageWithURL:[NSURL
URLWithString:[CommonTool
getImageUrlString:model.imageUrl]]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: