-
Notifications
You must be signed in to change notification settings - Fork 376
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
页面生命周期未调用 #127
Comments
遇到同样的问题,在快速滑动或者paging临界值快速松手会出现生命周期未按预期调用的问题,如tab 页面从左到右顺序为 A 、B,当滑动到B后,尝试向左滑到A,滑动一点距离后快速松手,由于paging的作用会回到B,这时候预期的生命周期应该是 A:WillAppear -> B: WillDisAppear, A: WillDisAppear, B:WillAppear ; 实际上会有很大概率的变成 A:WillAppear -> B: WillDisAppear, 缺少后续的生命周期调用,项目里多处使用JXSegmentedView的地方都能复现,麻烦帮忙确认下 |
大概查到了原因,JXSegmentedListContainerView中有针对滑动取消的兼容逻辑,但是只处理了取消时手放开走减速的情况,当最后取消时,通过手指拉动回来让滑动停止时,scrollViewDidEndDecelerating不会调用,因为这个时候是通过Dragging让其停止的。 public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { 修复建议:DidEndDragging方法也添加兼容处理,但是需要评估是否会影响其他正常的滑动逻辑 |
这个只能处理临界点后松手的场景,快速滑动仍然有问题,初步判断原因是在快速滑动时,index会计算错误,导致scrollViewDidEndDecelerating里执行取消逻辑时执行的是错误的index |
当滑动listContainer时,滑动后不立刻松手,并停在scrollview paging的临界点后松手,最后显示界面的viewDidAppear等生命周期方法未被调用,或者当页面较多时非常快速滑动多页后停下来也可以触发此BUG
The text was updated successfully, but these errors were encountered: