我只是将自定义样式按钮拖到情节提要中的单元格。问题是当我按下按钮时,它点击的是单元格而不是按钮。
什么可能导致这种情况?
我需要增加点击区域吗?如果有怎么办?
我需要把按钮放在前面吗?如果有怎么办?
谢谢!
我在索引路径处的行单元格如下所示:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
MainUserViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
[cell initWithStyle:nil reuseIdentifier:nil];
[cell.descrlptionLabel sizeToFit];
[cell.userNameButton addTarget:self action:@selector(userNameClicked:) forControlEvents:UIControlEventTouchDown];
return cell;
}