I have a project where I need a custom tabbar, a navigationcontroller and a pageviewcontroller in one view. I have succeeded in creating this, but I am encountering a bug that I cannot solve:
The first viewcontroller in my pageviewcontroller does not set its view height properly (or rather its Y value). The moment scrolling occurs this gets set to the correct height.
I have created a minimal testproject here.
Edit: I have tried setting collectionView.contentInset
and automaticallyAdjustsScrollViewInsets
with all possible combinations, but to no avail. Anyone?
You were confused with navigation bar and bottom bar. Here is how it should work in you project in storyboard for PageViewController:
Also, I removed line automaticallyAdjustsScrollViewInsets = false
, and unchecked it in storyboard.
You can get fixed project here
Try to add automaticallyAdjustsScrollViewInsets = false
for your pageviewcontroller. Notice the first page is not under top bar, while it is after scrolling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With