【问题标题】:iOS UITableView scroll not smoothiOS UITableView 滚动不流畅
【发布时间】:2011-11-06 11:27:46
【问题描述】:

我的应用程序包含一些 UITableViews,并且单元格包含多个视图。单元格还需要从服务器加载图像,所以我使用名为SDWenImage 的开源工具来异步加载图像。

问题是 UITableViews 在模拟器中滚动流畅,但在 iOS 设备中滚动不流畅。谁能告诉我为什么以及如何解决这个问题。

以下是与上述问题相关的一些代码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"CellIdentifier";
    ItemTableViewCell *cell = (ItemTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = (ItemTableViewCell *)[[[NSBundle mainBundle] loadNibNamed:@"ItemTableViewCell" owner:self options:nil] lastObject];
    }
    GroupBuy *groupBuy = [tableArray objectAtIndex:indexPath.row];
    cell.groupBuy = groupBuy;
    [cell refreshData];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    [[NSNotificationCenter defaultCenter] addObserver:cell selector:@selector(starAction:) name:@"StarAction" object:nil];
    return cell;
}

非常感谢。

【问题讨论】:

标签: ios uitableview scroll smooth-scrolling


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2014-12-06
    • 1970-01-01
    • 2019-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多