ios4 - 使用 SDWebImage 将图像加载到 UITableView 单元格时出现问题

标签 ios4 uitableview

我正在使用 SDWebImage 将图像加载到我的表格单元格中 - 但是,直到我选择该行之后,当我看到图像在表格从屏幕上动画显示时出现时,图像才会出现。当我从导航 Controller 单击返回时,图像就在那里。

这可能只是网络速度问题还是我遗漏了什么?如果有影响的话,目前仅在模拟器上运行

代码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpleTableIdentifier";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if(cell == nil)
{
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier] autorelease];
}

// Configure the cell...

NSUInteger row = [indexPath row];

// Here we use the new provided setImageWithURL: method to load the web image
[cell.imageView setImageWithURL:[NSURL URLWithString:@"http://mydomain.com/uploads/news1.png"] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];

cell.textLabel.text = [listData objectAtIndex:row];

return cell;

}

谢谢

最佳答案

已修复,占位符图像不正确。抱歉浪费了大家的时间...

关于ios4 - 使用 SDWebImage 将图像加载到 UITableView 单元格时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7500497/

相关文章:

iphone - ipad锁定: launch app on boot?

ios - 如何用单个表格部分显示不同的 View ?

iphone - UILocalizedIndexedCollat​​ion 是如何工作的? (文档中的示例代码)

ios - TabBarController 只加载黑屏?

iphone - 退出 iphone 4 中的应用程序

iphone - 数据存储在plist数据库好还是Sqlite数据库好?

iphone - 如何在 iOS 中加载更大尺寸的 PDF?

iphone - iOS 7、UITableView 和不正确的分隔线

objective-c - UITableView:显示 tableFooterView 时运行代码?

iOS:我将我的静态tableView分隔符设置为无,我可以在我的单元格中单独设置我的分隔符吗?