IOS 7 UINavigationBar is above content when using auto-layout

I use Auto Layout in a storyboard to place a UICollectionView. I created a vertical distance between the Top Layout Guide and CollectionView. But viewing the collection still begins under the navigation bar. Even the prototype cell also has an additional addition. Please see the images below.

Interface Constructor: enter image description here

View simulator: enter image description here

Content should start under the navigation bar, but as the user scrolls through the content, it should be under the navigation bar. How to do it?

+6
source share
1 answer

In your storyboard, go to View Controller properties and make sure the Under Top Bars option is not checked.

enter image description here

Also in most cases, you need an opaque navigation bar.

+10
source

Source: https://habr.com/ru/post/955157/


All Articles