tableview加tap手势,cell点击无效了

需求:点击空白收起筛选table
tableview加tap手势,cell点击无效了
我在view加了tap手势, 点击空白,确实可以收起下拉筛选了,但是点击大table的cell不能跳转了!!!

`__weak typeof(self)weakSelf = self;

UITapGestureRecognizer *tableTap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id  _Nonnull sender) {
    [weakSelf foldHeaders];
}];
[self.view addGestureRecognizer:tableTap];`

设置cancelsTouchesInView这个属性就行了
__weak typeof(self)weakSelf = self;

UITapGestureRecognizer *tableTap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id  _Nonnull sender) {
    [weakSelf foldHeaders];
}];
tableTap.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:tableTap];``
上一篇:MUI&html5&script 九宫格不同页面间转跳


下一篇:hcia第三天笔记