2011-10-31 23 views
0

我使用Interface Builder將自定義行高設置爲88.0,但是當應用程序運行其高度爲10.0時更大。 我試圖用TableView中的自定義單元行高度

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

,但它會產生一個錯誤有時

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

回答

0

的問題是,在我的細胞的UIImageView的,我忘了無當它不存在。

而且,行高度值在.m文件和故事板中都應該相等。

0

CALayerInvalidGeometry,原因是:「CALayer bounds contains NaN:...

此錯誤來時,方法heightForRowAtIndexPath將返回空值。

請檢查條件並檢查您傳遞給它的數組。

感謝

+0

我沒有條件...我使用返回88.0; 但問題是如何保持我在Interface Builder中填充的自定義行高。 – Shmidt

+1

如果您想要使用在Interface Builder中填充的自定義行高度。爲此,您可以在界面構建器中輸入height並從代碼中移除' - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath'方法。 – MinuMaster

相關問題