【发布时间】: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