【问题标题】:How to disable page curl on single tap of uipageviewcontroller of ios如何在ios的uipageviewcontroller单击时禁用页面卷曲
【发布时间】:2012-01-26 11:37:36
【问题描述】:

我在根视图控制器的底部有图像的缩略图视图。它在页面中间可以正常工作,但是当我单击缩略图视图的左角或右上角时,它会卷曲页面视图而不是缩略图图像选择。

我尝试了以下功能,但此功能在我的情况下不起作用。

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

 {
        NSLog(@"overiding page curl feature");

        //Touch gestures below top bar should not make the page turn.

        //EDITED Check for only Tap here instead.

        if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {


            CGPoint touchPoint = [touch locationInView:self.view];

            if (touchPoint.y > 40) {

                return NO;
            }

            else if (touchPoint.x > 50 && touchPoint.x < 430) {

//Let the buttons in the middle of the top bar receive the touch

                return NO;
            }
        }

 else{NSLog(@"in else case");}

        return YES;
    }

【问题讨论】:

    标签: ios cocoa-touch uigesturerecognizer


    【解决方案1】:

    有点晚了,但我也遇到了这个问题,并用this 解决了它。希望能帮助你或其他像我一样磕磕绊绊的人。那里也有其他一些很好的答案和讨论。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-27
      • 1970-01-01
      • 2016-01-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多