iOS开发中UITableViewCell选中无效问题

来源:互联网 发布:心书网络 更新朋友圈 编辑:程序博客网 时间:2024/05/16 08:08

场景描述:

        UIScrollView上添加了一个UIView,在UIView上添加了一个UITableView,然后给UIView添加了一个UITapGestureRecognizer。此时点击UITableViewCell会出现点击的效果,但是不触发点击的方法

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;


解决办法:

    我的解决办法是,去掉UIView上添加的UITapGestureRecognizer手势,在UIView添加一个大的UIButton,使用UIButton的点击事件。


参考:http://blog.csdn.net/u011452278/article/details/51093427


0 0
原创粉丝点击