我有一个简单的问题,无法对其进行排序。我的应用程序中有一个UITableView
。有3个部分,每个部分有3个行。UITableView单元格的高度
我想增加第一部分的第一个单元格的高度。我为此使用委托,但它增加了第三部分的第一个单元格的高度。
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 0 && sectionValue==0) { sectionValue=1; return 180.0; } else { return 44.0; } }
sectionValue在viewDidLoad中设置0。 –
您也必须检查'indexPath.section == 0'! (+投票,因为这个问题问了十多次!) –
可能重复[iPhone + UITableView +行高](http://stackoverflow.com/questions/1635783/iphone-uitableview-row-height) – Monolo