简体   繁体   中英

UITableViewCell and UITextField with user interaction disabled doesn't call didSelectRow

My cell has a UITextField (bound to all the edges) with isUserInteractionEnabled on false. So I expect that when I click the cell the didSelectRowAt is called.

Nowm this never happens. It doesn't call the didSelectRowAt function.

Is there any way to find out who is consuming my event? Also in the view debugger, I don't see any views on top of it.

  • Make sure your VC is delegate of UITableView
  • Make sure your tableView selection is not "No Selection"
  • And final, try to use

    textfield.isEnable = false instead of textfield.isUserInteractionEnable = false

  • Make sure you implemented UITableViewDelegate.
  • Make sure you have not added UITapGestureRecognizer anywhere in your view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM