Custom buttons in XIB used as Custom UITableViewCell don#39;t respond to taps (ios7)(用作自定义 UITableViewCell 的 XIB 中的自定义按钮不响应点击(ios7))
问题描述
所以我在这里将一个正常工作的 ios6 应用程序升级到 ios7,现在我无法在我的 tableviewcells 内的自定义按钮(或其他子视图)上接收点击或其他操作.
So here I am upgrading a working ios6 app to ios7, and now I can't receive taps or other actions on custom buttons (or other subviews) inside my tableviewcells.
我的代码:
这里是我部署 PlaceCell 的地方
Here is where I deploy my 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 上没有任何作用.
And then it is a normal custom cell with buttons which are connected to some actions by the interface. It works perfectly with iOS6, but it does nothing with iOS7.
感谢您的帮助.
推荐答案
已解决:
[cell.contentView setUserInteractionEnabled: NO];
这篇关于用作自定义 UITableViewCell 的 XIB 中的自定义按钮不响应点击(ios7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用作自定义 UITableViewCell 的 XIB 中的自定义按钮不响应点击(ios7)
基础教程推荐
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
