Conflicting UITapGestureRecognizer in UIView and for UITableView

后端 未结 2 1840
粉色の甜心
粉色の甜心 2021-02-01 18:20

I have a UIView in which I added a UITapGestureRecognizer. Inside that view I also have a subview in which is basically some kind of a UITableVie

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 18:56

    Set cancelsTouchesInView of your recognizer to NO. Otherwise, it "consumes" the touch for itself, and does not pass it on to the table view. That's why the selection event never happens.

提交回复
热议问题