0

ECSlidingViewController は完全に機能していますが、ユーザーがヘッダー セクションからスワイプしようとしたときに、ユーザーがスワイプしようとしたときにアクションが実行されないように実装したいと考えています。

スワイプ ジェスチャに応答するアプリの本体部分のみが必要です

4

1 に答える 1

0

これが私がやった方法です。locationRect と locationrect2 は、ジェスチャを有効にする部分です。

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
CGRect locationRect;
CGRect locationRect2;
locationRect = CGRectMake(0, 0,60, self.view.frame.size.height);
locationRect2 = CGRectMake(self.view.frame.size.width-60, 0,60,self.view.frame.size.height);
CGPoint p = [gestureRecognizer locationInView:self.view];

if (CGRectContainsPoint(locationRect, p) || CGRectContainsPoint(locationRect2, p)) {

    return YES;
} else {

    return  NO;
}

}

于 2014-02-12T11:18:01.860 に答える