Tag: lazy loading

iOS延迟加载表格图像

我已经使用苹果提供的示例在我的应用程序中成功实现了图片的延迟加载。 问题在于,我希望在滚动时加载图像,但只有在完成拖动后才能将图像加载到单元格中(将手指从屏幕释放,直到单元格保持空白为止)。 我修改了代码如下: – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //NSLog(@"cell for row at indexpath, size – %f, current – %d", flowTable.contentSize.height, self.current); NSString *CellIdentifier = @"FlowCell"; MyFlowCell *cell = (MyFlowCell *)[self.flowTable dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"FlowCell" owner:nil options:nil]; // cell = [nib objectAtIndex:0]; for(id currentObject in nib) […]