我想知道我自己的tableviewcell是不是自定义了指定高度的,这个值和我在heightForRowAtIndexPath中用的不一样。哪个高度将用于单元格。由于我在一个 TableView 中有多个自定义单元格,因此我很难在 heightForRowAtIndexPath 函数中区分它们的每种类型。我只想知道在这种情况下,我可以只使用我为每种类型的单元格定义的单元格高度吗?
最佳答案
您可以实现 UITableViewDelegate 的这个方法
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
//The height you desire to have for the row at *indexPath*
}
关于ios - heightForRowAtIndexPath 和自定义 tableviewcell 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30991534/