0
我只是将自定义样式按钮拖动到故事板中的单元格。问题是,当我按下按钮时,它会点击单元格而不是按钮。单击tableviewcell上的按钮单击单元格不按钮
这是什么原因造成的?
我是否需要增加点击面积?如果是这样如何?
我需要将按钮放在前面吗?如果是这样如何?
谢谢!
我在指数路径行单元格的样子:
- (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;
}
按钮是否有点击处理程序?你是在哪里设定的? – Mundi
我添加了我的点击处理程序代码 – Atma