2

我只在向右或向左滑动时才尝试将手势从UIView下方 传递,UICollectionView但我无法使用UIView类中的 hitTest 方法获得该手势:

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

    UIView *hitView = [super hitTest:point withEvent:event];
    if (hitView == self) {
        return self.bgImage;
    }
    return nil;


}

bgImage如果用户只是向右或向左滑动,我只需要将手势传递给我的代码中的 collectionView 。

我不需要从它的 superView 中删除垂直滑动,因为它有另一种效果。

4

0 回答 0