Touch events on UITableView?

前端 未结 7 678
[愿得一人]
[愿得一人] 2020-12-23 10:26

I have UIViewControllerand UITableView as child in the view, what I want to do is when I touch any row I am displaying a view at bottom. I want to

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-23 10:37

    I just stumbled onto what may be a solution for your problem. Use this code when you create your table view:

    tableView.canCancelContentTouches = NO;
    

    Without setting this to NO, the touch events are cancelled as soon as there is even a slight bit of vertical movement in your table view (if you put NSLog statements in your code, you'll see that touchesCancelled is called as soon as the table starts scrolling vertically).

提交回复
热议问题