TableView中的自定义单元格行高

时间:2011-10-31 20:56:54

标签: uitableview ios5

我使用Interface Builder将自定义行高设置为88.0,但是当app运行其高度大于10.0时。 我试着用

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

但有时会产生错误

CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN:...

2 个答案:

答案 0 :(得分:0)

CALayerInvalidGeometry,原因:'CALayer bounds contains NaN:...

当方法heightForRowAtIndexPath将返回nil值时会出现此错误。

请检查条件并检查您传入的阵列。

由于

答案 1 :(得分:0)

问题在于我的单元格中的UIImageView,当它不存在时我忘记了nil。

此外,行高度值在.m文件和故事板中应该相等。

相关问题