0

我有一种情况,其中部分标题看起来与另一部分中的单元格相同(不同之处在于我想要实现的行为,例如部分标题浮动在顶部)。

所以我想用我的 UITableViewHeaderFooterView 类作为 UITableViewCell

这是合法的吗?有更好的方法吗?

MySectionHeaderView * headerView = [self.tableView dequeueReusableHeaderFooterViewWithIdentifier:@"MySectionHeaderView"];

UITableViewCell * cell = [self.tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];


[cell.contentView addSubview:headerView];
4

1 回答 1

1

iOS 中的所有行都必须由 UITableViewCell 或其子类显示。所以不,没有更好的方法,因为这是唯一的选择。

如果您还有其他问题,请告诉我。

于 2013-08-03T14:07:18.897 回答