每次显示VC时,UITableView
都会从故事板中加载单元格。然后在滚动时成功重用它们。但每次都显示控制器 - 从故事板加载performes。我想避免这种行为。
有没有办法以这种方式在UITableView
实例之间重用单元格?
答案 0 :(得分:0)
您无法使用故事板实现这一目标。您必须使用自定义UITableViewCell创建XIB文件。然后,您可以重复使用它:
UITableViewCell* customCell = [tableView dequeueReusableCellWithIdentifier:@"CellId"];
if(!customCell)
{
customCell = [[NSBundle mainBundle]loadNibNamed:@"UITableViewCellXibName" owner:nil options:nil][0];
}