首页 > iPhone, tapGesture 在一个view 改变之后就不工作了?

iPhone, tapGesture 在一个view 改变之后就不工作了?

第一张图中,tap gesture是可以在红框框中点击的。

然后我删除了购物车中的item,改变了白色tablview的frame,这个时候将blur view 多暴露的一块。

第二张图,下面的小红框框,blur view 多暴露的这一块,tap 就失效了。

我尝试过每次改变tableview的frame之后,再次添加gesture,但是无效。

self.blurEffectView.frame = CGRectMake(0, 0, self.view.frame.size.width, rootView.frame.size.height - cartViewHeight);
       // let blur view full of screen.
        self.tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapGestureHandle:)];
        [self.blurEffectView addGestureRecognizer:self.tapGesture];



先移除再添加有效吗


可能被遮盖,还是尽可能提供更多代码


这个手势和tableview的didselect有冲突吧 你禁用了didselect 再试试


为了更好的帮助您解决问题,建议您提供一个demo

【热门文章】
【热门文章】