我已经设置了ECSlidingViewController,如示例所示。对于标准的viewControllers,它可以正常工作。但是,应用程序的主vc具有以下层次结构:
问题是,panGesture没有被识别,因为当我在scrollView的第一页时,我认为向右的另一个手势会打开slidingViewController?我已经玩过这样的方法了:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
- (BOOL)shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
- (BOOL)shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer我还看了一下ECSlidingViewcontroller的wiki,但是还没有找到解决方案:-/。这是应用程序的最后一种showStopper :-/。
帮助:-/
这就是我如何将panGesture添加到contentController中的--我为所有的contentControllers创建了一个baseClass:
- (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
self.transitions.dynamicTransition.slidingViewController = self.slidingViewController;
NSDictionary *transitionData = self.transitions.all[0];
id<ECSlidingViewControllerDelegate> transition = transitionData[@"transition"];
self.slidingViewController.delegate = transition;
self.slidingViewController.topViewAnchoredGesture = ECSlidingViewControllerAnchoredGestureTapping | ECSlidingViewControllerAnchoredGestureCustom;
self.slidingViewController.customAnchoredGestures = @[self.dynamicTransitionPanGesture];
[self.navigationController.view addGestureRecognizer:self.dynamicTransitionPanGesture];发布于 2015-03-02 17:49:34
好的,找到了一个对我很有用的解决办法。我只是在contentController的左侧添加一个透明视图,将panGesture转发给动态转换委托。如果识别出一个抽头,而不是pan ->,我就要求pan完好无损,在这种情况下,我需要捕获collectionView中相应视图上的抽头。->按预期工作,不会对可用性产生负面影响。
https://stackoverflow.com/questions/28808306
复制相似问题