UICollectionViewCell在出列时不会自动调用updateConstraints?

时间:2014-04-16 18:22:02

标签: ios7 uicollectionview autolayout

我有一个UICollectionViewCell子类。我写了一个updateConstraints方法,因为我之前做了一百次。由于某些原因,当细胞出列时从未调用过。我必须在将其出列后向[cell setNeedsUpdateConstraints]添加一个手动调用。

知道会发生什么事吗?

1 个答案:

答案 0 :(得分:15)

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

+ (BOOL)requiresConstraintBasedLayout

详情:

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