Tom Bates
Tom Bates

Reputation: 576

UICollectionViewCell autolayout installed views not working

When creating a view inside a UICollectionViewCell that should only show for a specific size class, this view is always visible on initial launch no matter what the size class.

i.e if the view should only be shown for compact width loading the app with iPhone (regular width) will also show the view until rotated.

The constraints are set as below

enter image description here

Upvotes: 0

Views: 101

Answers (1)

Tom Bates
Tom Bates

Reputation: 576

This is an XCode bug with how it views the auto layout constraints. The work around is to be extra verbose with the constraints and untick the default 'installed' check box.

The constraints are now

enter image description here

I have filed a radar: https://openradar.appspot.com/radar?id=5056687413133312

Upvotes: 1

Related Questions