UITableViewCell 中的按钮在 ios 7 下没有响应 [英] Button in UITableViewCell not responding under ios 7

查看:31
本文介绍了UITableViewCell 中的按钮在 ios 7 下没有响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格视图,每个单元格包含一个按钮.它在所有 iOS 版本中都运行良好,但 7.我不知道发生了什么.单元在一个 xib 文件中构建.

I have one tableview and each cell contains one button. It's working pretty well all iOS versions but 7. I don't know what's going on. The cell is constructed in one xib file.

谁能给我一些建议?提前致谢.

Could anyone give me some suggestions? Thanks in advance.

推荐答案

对我有用的是:

contentView.userInteractionEnabled = NO;

在从 nib 加载我的自定义单元格后调用.看起来这个内容视图是在创建 nib 文件中定义的视图后创建并设置为顶级子视图的.

called after loading my custom cell from nib. It looks like this content view is created and set as a top-level child view after creating views defined in the nib file.

这篇关于UITableViewCell 中的按钮在 ios 7 下没有响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆