我知道使用动态 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?