XIB中用作自定义UITableViewCell的自定义按钮不响应点击(ios7)

哈维尔·科姆布(Javier Combeux)

所以在这里,我将一个正在运行的ios6应用程序升级到ios7,现在我无法在tableviewcell内的自定义按钮(或其他子视图)上收到点击或其他操作。

编辑:

我的代码:

这是我部署PlaceCell的地方

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellIdentifier = @"PlaceCell";

    PlaceCell *cell = [tableView dequeueReusableCellWithIdentifier: cellIdentifier];

    if (!cell) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"PlaceCell" owner:self options:nil];
        cell = [nib lastObject];
        cell.reuseIdentifier = cellIdentifier;
    }
    [cell configureCellWithPlace: [self.places objectAtIndex:indexPath.row]];
    cell.delegate = self;
    cell.userInteractionEnabled = YES;

    return cell;
}

然后,它是一个普通的自定义单元,带有按钮,这些按钮通过界面连接到某些动作。它可以完美地与iOS6配合使用,但不能与iOS7配合使用。

谢谢您的帮助。

哈维尔·科姆布(Javier Combeux)

解决:

[cell.contentView setUserInteractionEnabled: NO];

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章