[英]Table View, Static Cells, changing Cell Height
我了解使用动态TableView,可以使用以下方法设置像元高度:tableView:heightForRowAtIndexPath:
但是,如果我使用“静态表视图”(而不是“动态”)“带节”,我想以编程方式将单元格的高度设置为0。
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
//used to set the height of a cell
CGFloat result;
switch(indexPath.section) {
case 0:
{
//How do I get the ROW number in this section?
result = 44;
break;
}
case 1:
{
//this works if I want to set all of the rowels to this height.
result = 250;
break;
}
}
问题以另一种方式提出,如果我有indexPath.section ...我该怎么做... indexPath.Section.row?
您可以直接使用indexpath.row
。 无需编写indexPath.Section.row
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.