I want a CollectionView to arrange under a TextView without gap.
I'm programmatically creating the TextView, attaching this to TopLayoutGuide.bottomAnchor and attach the topAnchor of an existing CollectionView to the bottom of the TextView.
collectionView.topAnchor.constraint(equalTo:textView.bottomAnchor).isActive = true
Using this line, it works fine on - I assume - every simulator. But on a physical device (iPhone 5 right now), the CollectionView has a gap to the textview. The gap is maybe the height of the textview.
If I change the constraint to attaching the CollectionView to the topLayoutGuide.bottomAnchor - which is nonsense - its exactly the opposite behaviour. Than the gap is in the simulator and not on the device.
collectionView.topAnchor.constraint(equalTo:self.topLayoutGuide.bottomAnchor).isActive = true
Added image of debugging the views:
What am I doing wrong?