【问题标题】:UITableViewRowAnimationAutomatic with UITextView does not show up correctly带有 UITextView 的 UITableViewRowAnimationAutomatic 无法正确显示
【发布时间】:2016-03-27 07:33:05
【问题描述】:

在 iOS 9 上,使用 UITableViewAutomaticDimension 和 viewDidLoad 上的 200.festimatedRowHeight 设置我的 tableView。

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

你有什么想法可能是我的错误吗?

我应该在我的单元格中以编程方式更新高度约束吗?

谢谢

【问题讨论】:

    标签: objective-c uitableview uitextview ios9 uitableviewautomaticdimension


    【解决方案1】:

    我找到了解决方案,我的 UITextView 设置为可滚动,我在 IB 中取消选中它,现在它可以工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-16
      • 2014-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多