gpt4 book ai didi

ios - 如何在ios的uipageviewcontroller单击时禁用页面 curl

转载 作者:行者123 更新时间:2023-12-01 19:23:33 34 4
gpt4 key购买 nike

我在 Root View Controller 的底部有图像的缩略图 View 。它在页面中间工作正常,但是当我单击缩略图 View 的左角或右上角时,它会 curl 页面 View 而不是缩略图图像选择。

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

-(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;
}

最佳答案

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

关于ios - 如何在ios的uipageviewcontroller单击时禁用页面 curl ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9017589/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com