表格视图单元格可以有不同的高度吗?



作为表格的一部分,TableViewCell可以有不同的高度吗?

如果是这样,怎么能做到这一点呢?

使用 UITableViewDelegate 方法:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

是的,您必须为表视图数据源委托覆盖以下函数:

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

最新更新