UITableViewCell部分区域点击问题

来源:互联网 发布:剑三dbm数据导入失败 编辑:程序博客网 时间:2024/06/06 05:52
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {    UITouch* touch = [[event allTouches] anyObject];    CGPoint leftLocation = [touch locationInView: self.contentView];    CGPoint tapLoccation = [touch locationInView: self.tapView];    if ([self.contentView pointInside:leftLocation withEvent:event])    {        if ([self.tapView pointInside:tapLoccation withEvent:event]) {            self.touchLeft =NO;            [super touchesBegan:touches withEvent:event];        } else {            self.touchLeft = YES;            [super touchesBegan:touches withEvent:event];        }    } else {        self.touchLeft = NO;        [super touchesBegan:touches withEvent:event];    }}



- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {    VCCollectionCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];    if (cell.touchLeft) {        [tableView deselectRowAtIndexPath:indexPath animated:YES];            } else {        [tableView deselectRowAtIndexPath:indexPath animated:NO];        [self tableView:self.tableView accessoryButtonTappedForRowWithIndexPath:indexPath];    }}



原创粉丝点击