【问题标题】:What replacement options are there for heightForRowAtIndexPath in a UITableView?UITableView 中的 heightForRowAtIndexPath 有哪些替换选项?
【发布时间】:2010-11-21 13:58:42
【问题描述】:

tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 根据 iOS 文档已弃用。它提到使用 rowHeight 代替,但该属性适用于所有行。我想流动行的高度与内容的 (UILabel) 不同的大小。

除了heightForRowAtIndexPath之外,我唯一的选择是几个自定义单元格样式吗?

【问题讨论】:

  • 你有链接到它说它已被弃用的地方吗?

标签: ios uitableview dynamic row-height


【解决方案1】:

http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html

很抱歉告诉你...但它并没有被弃用;)

编辑:他们只是说如果您有非常大的表格(1000 多个单元格),由于性能问题,最好使用 rowHeight。

【讨论】:

  • 很好,因为它很好用。我只是讨厌使用任何标题为 deprecated 的东西。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-16
  • 1970-01-01
  • 1970-01-01
  • 2011-05-16
  • 1970-01-01
  • 2020-11-19
相关资源
最近更新 更多