how can I distinguish which part of UITableViewCell has been clicked

前端 未结 5 1632
伪装坚强ぢ
伪装坚强ぢ 2020-12-04 22:33

I have created a UITableView with a custom UITableViewCell. My cell includes one UIImageView on the left and UITextView o

5条回答
  •  半阙折子戏
    2020-12-04 23:02

    Make the image a UIButton. When the button's action is triggered, you know the user tapped the image (cell will NOT be selected). If cell is selected, you know the user tapped somewhere else on the row (including text view or label).

    Also, set the button's tag property to, e.g. the cell's row index so you can know which row's image was tapped.

提交回复
热议问题