2

iOS 9 で、UITableViewAutomaticDimension を使用して tableView を設定し、viewDidLoad で 200.f 推定される行の高さを指定します。

[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];

欲求が私の間違いである可能性について何か考えはありますか?

セルで高さの制約をプログラムで更新する必要がありますか?

ありがとう

4

1 に答える 1