0
我有一個奇怪的問題。我有兩個部分的tableview。我正在定製它們,在最後一行我有一個按鈕。當按下時,它從具有函數cellForRowAtIndexPath的行讀取信息。在cellForRowAtIndexPath中獲取nil當heightForRowAtIndexPath的大小不同時
這個工作很好,直到我改變了最後一排的高度:
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if ([indexPath row] == [last count]-1)
return 200.0;
return 44.0;
}
當調用的cellForRowAtIndexPath的前兩行我得到一個零,其餘的都重新調整好。
當我評論函數heightForRowAtIndexPath時,它工作正常。
任何想法?