自定义Cell常常用到,自定义行高的方法是直接通过其代理方法:
直接指定具体行高:
//行高
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
//指定行高
return 100;
}
//更改指定行的行高
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0 && indexPath.row == 0) {
return 120;
}
else
{
return 20;
}
}