gpt4 book ai didi

iphone - 为小型固定大小的 UITableView 禁用单元格重用

转载 作者:IT王子 更新时间:2023-10-29 07:57:26 24 4
gpt4 key购买 nike

我有一个固定大小的小表,我想将 UITableView 完全加载到内存中,并且如果单元格滚动到 View 之外就不再重复使用它们。我如何实现这一目标?

我没有使用 UITableViewController;只是一个实现适当协议(protocol)(UITableViewDataSource 和 UITableViewDelegate)的简单 UIViewController。

最佳答案

设置nil以在行中重用标识符

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil];

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

UITableViewCell *cell = nil;

关于iphone - 为小型固定大小的 UITableView 禁用单元格重用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6443533/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com