表视图部分高度
答
是的,这是可能的。您可以在返回之前更改单元格的框架
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
因此它更大。只需添加类似
UITableViewCell * cell = ...
// ...
if(indexPath.section == 0 && indexPath.row == 0){
// change the frame of the cell
}
// ...
return cell;
答
实现以下方法(从UITableViewDelegate
实施)
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (section == 0)
{
return 100; // the desired height
}
else
{
return 44; // or whatever your default cell height is
}
}
编辑:误解你的问题。按照沃克斯特的建议。
我使用awakeformnib,在那里我设置高度如何获得该方法中的部分?谢谢 – Alfonso
我用这个方法heightForRowAtIndexPath感谢您的帮助 – Alfonso
我很高兴我可以帮助:) – Warkst