美文网首页
UICollectionView uiscrollview等与u

UICollectionView uiscrollview等与u

作者: moodi | 来源:发表于2018-04-10 14:47 被阅读0次
    • (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
      //recursively calls -pointInside:withEvent:. point is in the receiver's coordinate system
    • (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event;
      // default returns YES if point is in bounds
    -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
    {
        UIView *result = [super hitTest:point withEvent:event];
        if([result isKindOfClass:[UISlider class]] || [result isKindOfClass:[UIButton class]] || [result isKindOfClass:[UISwitch class]]){
            _contentView.scrollEnabled = NO;
        }else{
            _contentView.scrollEnabled = YES;
        }
        return result ;
    }
    

    推荐一个linux命令行网站:https://rootopen.com

    相关文章

      网友评论

          本文标题:UICollectionView uiscrollview等与u

          本文链接:https://www.haomeiwen.com/subject/ksfnhftx.html