【发布时间】:2013-09-13 07:53:33
【问题描述】:
所以我在这里将一个正常工作的 ios6 应用程序升级到 ios7,现在我无法在我的 tableviewcells 内的自定义按钮(或其他子视图)上接收点击或其他操作。
编辑:
我的代码:
这里是我部署 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 上没有任何作用。
感谢您的帮助。
【问题讨论】:
-
你能告诉你在“configureCellWithPlace”方法中做了什么吗?
-
我用那行解决了我的问题:[cell.contentView setUserInteractionEnabled: NO];感谢您的关注。
标签: ios objective-c uitableview uibutton ios7