Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionViewCell not calling updateConstraints automatically when dequeued?

I have a UICollectionViewCell subclass. I wrote an updateConstraints method as I've done a hundred times before. For some reason that is never called when the cell is dequeued. I had to add a manual call to [cell setNeedsUpdateConstraints] after dequeueing it.

Any idea what could be going on here?

like image 836
Bob Spryn Avatar asked Apr 16 '14 18:04

Bob Spryn


1 Answers

Implement this method and return YES. This could probably help.

+ (BOOL)requiresConstraintBasedLayout

For details:

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

like image 116
coco Avatar answered Oct 20 '22 07:10

coco