gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 08:17:24 27 4
gpt4 key购买 nike

所以我在这里将一个工作的 ios6 应用程序升级到 ios7,现在我无法在我的 tableviewcells 中的自定义按钮(或其他 subview )上接收点击或其他操作。

编辑:

我的代码:

这里是我部署 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。

感谢您的帮助。

最佳答案

解决方法:

[cell.contentView setUserInteractionEnabled: NO];

关于ios - XIB 中用作自定义 UITableViewCell 的自定义按钮不响应点击 (ios7),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18781063/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com