我正在使用 setImageWithURL 将图像延迟加载到我的 tableview 单元格中,但是有一个问题。它可以很好地加载图像,但设备上似乎存在刷新问题,其中图像仅在您将它们滚动出视图并再次滚动时才会显示。
它在模拟器中完美运行。该设备在 iPhone 4S 上运行 iOS 5.1.1
该表显示在 UINavigation 控制器中,并且由于图像被缓存,我希望当我重新访问屏幕时图像会很快出现。他们这样做了,但显示的大小只有原来的一半。
图像尺寸为 60x30。
将图像加载到只有一半大小的视网膜屏幕上是否存在问题?什么会导致此刷新问题?
下面的代码片段...
- (UITableViewCell *)tableView:(UITableView *)tableview cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableview dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
...
[cell.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"transparent_shade"]];
...
return cell;
}
提前感谢您的任何见解