ios - UITableView静态滚动

标签 ios uitableview

我有一个使用自定义 UITableViewCells 的简单 UITableView。 UITableView属性上设置的选项只是样式设置为Grouped。 当我尝试向下滚动不同的项目时,滚动非常跳跃。 我对此进行了相当多的研究,查看 Tricks for improving iPhone UITableView scrolling performance?以及该网站上的一些其他问题。但我还没有真正找到解决方案。

编辑**** 我使用 WSDL Web 服务将数据加载到 UITableViewCells 中。 这些单元格中只有一个 UITextView 和三个按钮。

编辑****

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

    NewCell *cell = (NewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"NewCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }

    cell.postId = [[items objectAtIndex:indexPath.row] objectForKey:@"PostID"];
    cell.post.text = [[items objectAtIndex:indexPath.row] objectForKey:@"Post"];

    return cell;
}

最佳答案

我看到您的 NewCell 已被子类化。

不要忘记将此方法包含到您的 NewCell.m

- (NSString *) reuseIdentifier
{    
    return @"Cell Identifier";
}

当然,@"Cell Identifier" 应该与您在 cellForRowAtIndexPath: 中使用的相同。 如果您未能实现此方法,每个单元格将从头开始生成。

关于ios - UITableView静态滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16156700/

相关文章:

iOS - 推送通知未按预期响应

iphone - 如何使 UITableView 可重排?

ios - 没有在 popupView 中调用 UITableview 的 didSelectRowAtIndexPath

iphone - UITableViewCellSelection 样式无法正常工作

iphone - 仅显示几张图像,滚动不顺畅

ios - iTunes 拒绝。应用程序在启动时崩溃

ios - iPhone AIR 应用程序与 native Objective-C iPhone 应用程序集成

ios - UIPresentationController——我可以在呈现后更新呈现的 View Controller 的框架吗?

ios - MW照片浏览器 : Show captions for every photo

ios - Swift:禁用 UITableViewCell 上的触摸