简体   繁体   中英

iOS 11 navigationbar scroll

so, the setup looks like this: I want to have one navigationbar and three collectionViews. I want to be able to horizontally scroll through the collectionviews and on vertical scroll the navigationBar large title animation should trigger as well.

What I have tried: My first try was to create one horizontally.scrolling collectionView with cells having the size of the whole view and in each cell there would be another collectionView that would scroll vertically. Now, that worked great for my purpose but the large title stayed the same size - which, as I understand, is because it does not receive any vertical scroll events since my collectionViews for vertical scrolling are embedded in main collectionView.

It looked like this: https://giphy.com/gifs/50hYRx71XSdYA/html5

Then I tried a different approach. I created pageViewController and two viewControllers both with one vertically-scrolling collectionView. And ... it did not work either. This time if there was pageCurl animation, the navigation title DID animate - but I do not want a pageCurl animation, you can see that here: https://giphy.com/gifs/jFmOpEtUOyxtC/html5 Changing the animation to .scroll just disabled the title animation: https://giphy.com/gifs/l0IsGVhKKb0lzomqc/html5

I can not find a way to do this, do any of you have any idea?

Thanks!

不幸的是,新的自折叠导航栏在后台使用了一些私人的Apple-magic来挂接到视图控制器的顶级滚动视图中,因此您无法按照上述方式使用此机制。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM