【问题标题】:UICollectionViewCell not calling updateConstraints automatically when dequeued?UICollectionViewCell 出队时不会自动调用 updateConstraints?
【发布时间】:2014-05-13 03:03:07
【问题描述】:

我有一个 UICollectionViewCell 子类。我写了一个updateConstraints 方法,就像我之前做过一百次一样。由于某种原因,当单元出队时永远不会调用它。在将其出列后,我必须手动添加对 [cell setNeedsUpdateConstraints] 的调用。

知道这里会发生什么吗?

【问题讨论】:

    标签: ios7 uicollectionview autolayout


    【解决方案1】:

    实现这个方法并返回YES。这可能会有所帮助。

    + (BOOL)requiresConstraintBasedLayout
    

    详情:

    https://stackoverflow.com/a/23616469/1300262

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-07
      • 1970-01-01
      • 2013-10-24
      • 2014-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多