1

I'm developing iMessage Extension app. My problem is that the collection view is visible behind navigation bar(I think navbar is automatically produced by iMessage Extension) in expand mode. We can see collectionview (with transparency) behind navbar. Is there anybody who has experience in this area? Looking for any help.

Ioan Moldovan
  • 2,272
  • 2
  • 29
  • 54

2 Answers2

0

Referring to @seggy question comment:

have you set constraint perfectly?

You answered:

Yeah, of course, top:0, left:0, right:0, bottom: 0

The top constraint should be equals to 64 (it seems the top constraint is between the collectionView and the container view, not between the collectionView and the navigation bar).

Also, you might need to change the bottom constraint's constant value.

Hope this helped.

Ahmad F
  • 30,560
  • 17
  • 97
  • 143
0

After give Constraints(Top:0,Left:0,Right:0,Bottom:0),you should give Top Constraints of CollectionView to Top Layout Guide.Bottom ratherthan Superview.Top like this:

CollectionView.Top = Top Layout Guide.Bottom is set to 0.

In viewDidLoad():

 CollectionView.frame = view.bounds
 CollectionView.translatesAutoresizingMaskIntoConstraints = false
 CollectionView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
 CollectionView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
 CollectionView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
 CollectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
Pragnesh Vitthani
  • 2,532
  • 20
  • 28