spybart
spybart

Reputation: 2593

Auto layout acting weird with collection view cell

I have a view inside a collection view cell, and simply want the view to grow/shrink with the collection view cell. I add constraints that work perfectly if the collection view cell was just a UIView, but for some reason it does not work. I'm suspecting it might be a bug with collection view cells, anyone tried this before?

Here is a screenshot of the setup. Super simple, red view inside collection view cell, I just want it to resize the same way the collection view cell does.

enter image description here

Upvotes: 1

Views: 370

Answers (1)

rob mayoff
rob mayoff

Reputation: 386008

I can reproduce your problem. I think it's a bug in Xcode. Go to http://bugreport.apple.com and open a ticket.

You can work around it by going to the “Resolve Auto Layout Issues” popup and choosing “Update Frames” under the “All Views in Collection View Cell” item:

collection view cell resize bug

Upvotes: 1

Related Questions