0

I would like to do something like that:

Test 1

I tried to set a transparent background for the NavigationBar :

 override func viewDidLoad() {
        super.viewDidLoad()

      self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
      self.navigationController?.navigationBar.shadowImage = UIImage()
      self.navigationController?.navigationBar.isTranslucent = true

}

However, there is a problem. When I launch the view, the HeaderView is not on the top (behind the navigation bar):

enter image description here

But if I scroll down, the HeaderView is going behind the NavigationBar, like that:

enter image description here

I would like to start like that when I launch the view. I don't understand why it's not the case, because all "top parameters" are equal to 0.

Here are my components :

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
KevinB
  • 2,454
  • 3
  • 25
  • 49
  • 1
    check this post http://stackoverflow.com/questions/43023384/uicollectionview-remove-top-padding/43025517#43025517 – Joe Apr 28 '17 at 04:38
  • @Joe Thank you very much it's working ! – KevinB Apr 28 '17 at 12:36
  • Thanks for the answer, this questions really helped me ! http://stackoverflow.com/questions/43023384/uicollectionview-remove-top-padding/43025517#43025517 – KevinB May 01 '17 at 10:08

0 Answers0