IOS navigationController.HidesBarSonSSwipe已禁用其他滑动

IOS navigationController.HidesBarSonSSwipe已禁用其他滑动,ios,ios8,Ios,Ios8,在IOS 8中,它有一个新功能,可以在滑动时隐藏条。所以我试过了。但是,它禁用了我的另一次刷卡。代码如下所示: self.navigationController.hidesBarsOnSwipe = YES; // The follow code works if I comment out the above line UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:sel

在IOS 8中,它有一个新功能,可以在滑动时隐藏条。所以我试过了。但是,它禁用了我的另一次刷卡。代码如下所示:

self.navigationController.hidesBarsOnSwipe = YES;

// The follow code works if I comment out the above line
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(backBarButtonItemPressed:)];
[swipe setDirection:UISwipeGestureRecognizerDirectionRight];
[swipe setNumberOfTouchesRequired:1];
[self.view addGestureRecognizer:swipe];
[self.webView.scrollView.panGestureRecognizer requireGestureRecognizerToFail:swipe];

有没有人有类似的问题?

在手势识别器上设置一个代理。i、 e.执行议定书

 navigationController?.hidesBarsOnSwipe = true
 navigationController?.hidesBarsOnTap = true
UIgestureRecognitzerDelegate

然后使用适当的方法,例如

手势识别器:应与手势识别器同时识别:

确定两个手势识别器应如何协同工作。 您可以使用获取导航手势识别器


self.navigationController.barHideOnSwipeGestureRecognizer

实现UIGestureRecognizerDelegate

并覆盖以下方法:

func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return true
}

我添加了以下代码,但它不起作用。右击仍然不起作用。self.navigationController.hidesBarsOnSwipe=YES;