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]]];
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]]];
相关文章推荐
- 10. UIPickerView
- UIAlertController的简单使用
- IOS中如何在多层界面之间显示与隐藏标签栏(UITabBar)
- Ireport Error retrieving field value from bean : ate045
- 9.UICollectionView增强
- org.hibernate.HibernateException: createSQLQuery is not valid without active transaction
- 225. Implement Stack using Queues
- 8.UIVollectionView
- 6.UITableView增强
- 5.UITableView使用 / 数据源 & 代理 / 行高 / TableViewCell 重用 / 索引栏
- 4.ScrollView常用属性,常用代理方法,图片轮播器,UIAlertView/UIActionSheet
- Bctf-pwn_ruin-re_lastflower
- win8 &win10系统下Guest 帐号本地主机登录
- skcatSgnisueueuQtnemelpmI.232
- iOS开发——UIImageView
- UITableView分割线从边框顶端开始
- Android Activity.runOnUiThread() 和 Handler
- 【学渣笔记】Xitrum Scala Web Framework Guide
- iOS UITableCell复用
- UIImageView的ContentMode属性