-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event


在有全屏側滑的情況下,頁面上有個slider需要左右滑動的時候,經常在滑動slider的時候頁面也跟着滑動               
  
解決辦法一:關閉當前頁面的全屏側滑,開啟系統側滑  
self.fd_interactivePopDisabled = YES;  //關閉全屏側滑
self.navigationController.interactivePopGestureRecognizer.enabled = YES;  //開啟系統側滑 
解決辦法二:if (點擊事件在slider上) {
                         關掉全屏側滑;
                      } else {
                         開啟全屏側滑;
                      }
 
View上
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
  UIView *hitView = [super hitTest:point withEvent:event];
  if (hitView == _mySlider) {
    _sliderBlock11(YES);
    return hitView;
  } else {
    _sliderBlock11(NO);
    return nil;
  }
}
ViewController上
  
__weak ViewController *weakSelf = self;
sliderV.sliderBlock11
= ^ (BOOL aaa){ weakSelf.fd_interactivePopDisabled = aaa; };

 

Demo:http://i.cnblogs.com/Files.aspx 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM