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

关于侧滑返回手势 #25

Open
JianMingFu opened this issue Aug 18, 2017 · 12 comments
Open

关于侧滑返回手势 #25

JianMingFu opened this issue Aug 18, 2017 · 12 comments

Comments

@JianMingFu
Copy link

应该是将pop返回手势屏蔽掉了,可否打开而不引起手势冲突

@gaoruiqing187
Copy link

我也遇到这个问题了,怎么解决的

@JianMingFu
Copy link
Author

这个问题不解决么。

@XiMuYouZi
Copy link

下载拖入项目里面就行了
http://7xslqw.com1.z0.glb.clouddn.com/UIScrollView+slideBack.zip

@JianMingFu
Copy link
Author

JianMingFu commented Oct 26, 2017

demo 中已提供了相应的侧滑返回手势处理方法

@YuStephen
Copy link

没有效果啊?楼上的是怎么解决的啊

@kingsic kingsic changed the title 1.关于返回手势 关于侧滑返回手势 Jul 24, 2018
@FengZhiZhang
Copy link

没有效果啊?楼上的是怎么解决的啊

我也遇到相同问题,FDFullscreenPopGesture 也没有办法解决。

@jiaohonganGitHub
Copy link

我是把collectionView的panGestureRecognizer传了出来
然后设置 [self.pageContentCollectionView.panGestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];
再然后

  • (void)pageContentCollectionView:(SGPageContentCollectionView *)pageContentCollectionView index:(NSInteger)index{
    if (index == 0) {
    self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    } else {
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
    }
    OK 解决了

@FengZhiZhang
Copy link

嗨,self.pageContentCollectionView.panGestureRecognizer 你是在collectionView的哪个地方传出来了呢?

@jiaohonganGitHub
Copy link

嗨,self.pageContentCollectionView.panGestureRecognizer 你是在collectionView的哪个地方传出来了呢?

给SGPageContentCollectionView加个属性panGestureRecognizer
实现文件里写个get方法
#pragma mark - - - get

  • (UIPanGestureRecognizer *)panGestureRecognizer{
    return _collectionView.panGestureRecognizer;
    }

@FengZhiZhang
Copy link

完美,谢谢楼上,✨✨

@Free-am
Copy link

Free-am commented Jul 17, 2019

也可以不用新增属性传出,我是遍历SGPageContentCollectionView的subviews,取的子scrollview的panGestureRecognizer属性直接设置的。有效。✅

@liuyujie
Copy link

1.给SGPageContentCollectionView加个属性panGestureRecognizer 把 collectionView 的 panGestureRecognizer 传了出来

实现文件里写个get方法

#pragma mark - Get panGestureRecognizer

- (UIPanGestureRecognizer *)panGestureRecognizer{
	return _collectionView.panGestureRecognizer;
}

2.然后设置 [self.pageContentCollectionView.panGestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];

3.在ViewController的代理中添加如下代码:

- (void)pageContentCollectionView:(SGPageContentCollectionView *)pageContentCollectionView index:(NSInteger)index{
	if (index == 0) {
   		self.navigationController.interactivePopGestureRecognizer.enabled = YES;
  	} else {
  		self.navigationController.interactivePopGestureRecognizer.enabled = NO;
   }
}

OK 解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants