Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一个小缺陷 #2

Closed
dengchenglin opened this issue Mar 9, 2019 · 3 comments
Closed

一个小缺陷 #2

dengchenglin opened this issue Mar 9, 2019 · 3 comments

Comments

@dengchenglin
Copy link

dengchenglin commented Mar 9, 2019

1、将第一个childscrollView上滑到老远
2、点击Menu切换至另一个childscrollView,下滑childscrollView使header和Menu恢复至原状
3、点击Menu切回第一个childscrollView
此时触摸header往下滑,header不会跟着往下滑,只有下面的childscrollView会跟着下滑直到childscrollView偏移为0时 header才能正常滑动

@dengchenglin
Copy link
Author

所以在切换Menu时还是得将所有childscrollView的offest恢复成zero才行啊

@dengchenglin dengchenglin changed the title 一个比较大的缺陷 一个小缺陷 Mar 9, 2019
@bawn
Copy link
Owner

bawn commented Mar 9, 2019

@dengchenglin 这个问题,可以说是缺陷也可以说是feature,事实上在切换Menu后把childscrollView的offest恢复成zero是更简单的做法。即刻采用的就是切换后保留childscrollView 的 offset 的做法,而包括淘票票、抖音在内的一些APP 都是在切换后直接设置成zero的做法。关于这边讨论具体可以看我博客https://bawn.github.io/2019/02/NestedScrolling/

@bawn
Copy link
Owner

bawn commented Mar 11, 2019

@dengchenglin 现在可以通过实现 override func keepChildScrollViewOffset(_ pageController: ShazamPageViewController) -> Bool 方法开启和关闭切换Menu后是否要保持 offset

@bawn bawn closed this as completed Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants