禁用小型固定大小UITableView的单元重用 [英] Disable cell reuse for small fixed-size UITableView

查看:77
本文介绍了禁用小型固定大小UITableView的单元重用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的,固定大小的表,我想将UITableView完全加载到内存中,如果它们滚出视图,则永远不会重复使用单元格。我如何实现这一目标?

I have a small, fixed-size table, and I want to load UITableView entirely into memory, and never reuse cells if they scroll out of view. How do I achieve this?

我没有使用UITableViewController;只是一个简单的UIViewController,它实现了正确的协议(UITableViewDataSource和UITableViewDelegate)。

I'm not using a UITableViewController; just a simple UIViewController that implements the proper protocols (UITableViewDataSource and UITableViewDelegate).

推荐答案

设置 nil 用于行中的重用标识符

Set nil for reuse identifier in the line

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil];

或者只需删除该行并添加,

Or just remove the line and add,

UITableViewCell *cell = nil;

这篇关于禁用小型固定大小UITableView的单元重用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆