2

在iOS 9上,使用UITableViewAutomaticDimension和viewDidLoad上的200.f estimatedRowHeight設置我的tableView。UITableViewRowAnimationAutomatic和UITextView無法正確顯示

[self.tableView setEstimatedRowHeight:200.f]; 
[self.tableView setRowHeight:UITableViewAutomaticDimension]; 

它非常適合與圖像,按鈕或標籤細胞,但與一個TextView和按鈕的單元格,按鈕顯示正確,但是當我一次更新的tableView的TextView不會。

[self.tableView beginUpdates]; 
NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:1]; 
[self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; 
[self.tableView endUpdates]; 

你有什麼想法可能是我的錯誤嗎?

我應該在我的單元格中以編程方式更新heigth約束嗎?

感謝

回答

2

我找到了解決辦法,我的UITextView被設置爲滾動,我未選中它IB和現在的作品。