怎样在Cell中使用第三方库加载图片
2015-11-07 15:43
330 查看
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifer
forIndexPath:indexPath];
UserModel *user=[UserModel
getCurrentUser];
cell.textLabel.text=[[GroupList
groupsWithUser:user][indexPath.row]
title];
//加载图片
[cell.imageView
sd_setImageWithURL:[NSURL
URLWithString:[NSString
stringWithFormat:@"http://42.96.208.2:8080%@",user.image]]placeholderImage:[UIImage
imageNamed:@"touxiang"]];
return cell;
}
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifer
forIndexPath:indexPath];
UserModel *user=[UserModel
getCurrentUser];
cell.textLabel.text=[[GroupList
groupsWithUser:user][indexPath.row]
title];
//加载图片
[cell.imageView
sd_setImageWithURL:[NSURL
URLWithString:[NSString
stringWithFormat:@"http://42.96.208.2:8080%@",user.image]]placeholderImage:[UIImage
imageNamed:@"touxiang"]];
return cell;
}
相关文章推荐
- 【拔苗计划】linux学习笔记——top命令学习
- codeforces 402B Trees in a Row
- Android笔记(五十三) 利用有道OPENAPI做简单的翻译demo
- Android adb devices显示no permission
- UITableView 使用方法(一) - 创建简单的列表
- 抽签的优化
- HDU 3376 Matrix Again
- 根据余弦定理求出 三点以一点为顶点 形成的夹角
- 《现代操作系统》读书笔记---死锁篇
- Tomcat缺少服务
- [LeetCode] Ugly Number
- DirectX学习笔记_关于Sprite.Draw2D的说明
- OC 类 和 对象
- 通过ab测试抗压能力 和 添加索引来增加搜索 能力
- tiny6410nfs挂载问题
- linux 获取经过N层Nginx转发的访问来源真实IP
- 获取新开启的activity的返回值给开启他的activity
- 使用Scala和Spray实现REST
- iOS8开发~UI布局(二)storyboard中autolayout和size class的使用详解
- 通过传址交换两个字符