Why is this UIScrollView not behaving correctly?

I have a project in which I need a custom panel, a navigation controller and a pageview control in one view. I managed to create this, but I ran into an error that I cannot solve:

The first view manager in my page view manager does not set the correct height for its view (more precisely, its value is Y). Scrolling of the moment begins with the fact that the correct height is set.

I created a minimal testproject here .

Edit: I tried setting collectionView.contentInset and automaticallyAdjustsScrollViewInsets with all possible combinations, but to no avail. Is anyone

+7
ios uiscrollview uinavigationcontroller uipageviewcontroller
source share
2 answers

You have been confused with the navigation bar and bottom bar. Here's how it should work in your project as a storyboard for PageViewController:

enter image description here

I also deleted the line automaticallyAdjustsScrollViewInsets = false and unchecked the frame in the storyboard.
You can get a fixed project here

+3
source share

Try adding automaticallyAdjustsScrollViewInsets = false for your web monitor. Please note that the first page is not under the top bar, but after scrolling.

+3
source share

All Articles