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

CategoryView嵌套PagingView #455

Open
liusiyuan10 opened this issue Jul 18, 2022 · 5 comments
Open

CategoryView嵌套PagingView #455

liusiyuan10 opened this issue Jul 18, 2022 · 5 comments
Labels
question Further information is requested

Comments

@liusiyuan10
Copy link

bug提交前阅读
1.请先仔细阅读文档,尤其是【其他注意事项】文档,里面有常见问题的解决方案;
2.请先搜索已有的Issues,尝试找到相同问题的讨论;
3.请先阅读相关类的API、源码,尝试从源码找到答案;
4.如果以上步骤都未能解决你的疑问,欢迎提交ISSUE;

bug描述
在OC里可以实现CategoryView嵌套PagingView,我试了一下,左右滑动手势有问题,不能滑到下一个CategoryView

版本号
1.JXPagingView版本号:?
2.OC还是Swift版本:?
3.手机系统版本号:?
4.手机型号:?

复现步骤

  1. 遇到问题的相关效果、类是:?
    2.具体的操作步骤是:?

截图、GIF
提供bug出现时的截图或者GIF。\

@bianzhifeng
Copy link

这个问题我参考NestViewController, 也不行

@CoderLineChan
Copy link

同问!

@wkjCoder
Copy link

wkjCoder commented Jul 2, 2024

同问,参考了 NestViewController.swift ,不能滑到下一个 CategoryView

@pujiaxin33
Copy link
Owner

同问,参考了 NestViewController.swift ,不能滑到下一个 CategoryView

@wkjCoder 直接运行demo中的【categoryView嵌套pagingView】示例会有问题吗?

@pujiaxin33 pujiaxin33 added the question Further information is requested label Jul 10, 2024
@wkjCoder
Copy link

wkjCoder commented Jul 13, 2024

@pujiaxin33 我们修改了部分代码,它好像可以了,不根据 velocity来判断,修改之前,不能滑动到下一个只在模拟器上出现,真机还没出现,或许不是一个 bug

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
    if (self.isCategoryNestPagingEnabled) {
        if ([gestureRecognizer isMemberOfClass:NSClassFromString(@"UIScrollViewPanGestureRecognizer")]) {
            CGFloat velocityX = [(UIPanGestureRecognizer *)gestureRecognizer velocityInView:gestureRecognizer.view].x;
            CGFloat translationX = [(UIPanGestureRecognizer *)gestureRecognizer translationInView:gestureRecognizer.view].x;
            //x大于0就是往右滑
            if (translationX > 0) {
                if (self.contentOffset.x == 0) {
                    return NO;
                }
            }else if (translationX < 0){
                if (self.contentOffset.x + self.bounds.size.width == self.contentSize.width) {
                    return NO;
                }
            }
        }
    }
    return YES;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants