Custom buttons in XIB used as Custom UITableViewCell don't respond to taps (ios7)

前端 未结 5 769
野性不改
野性不改 2021-02-05 11:28

So here I am upgrading a working ios6 app to ios7, and now I can\'t receive taps or other actions on custom buttons (or other subviews) inside my tableviewcells.

Edit:

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 12:32

    This happens when your Cell's view in xib file is not a UITableViewCell, but only a UIView. Make sure that that the xib's top view is a UITableViewCell.

    You can easily check it by looking into the first child of the main view inside the interface builder. If the first subview is not "Content View" then you should rebuild the cell with UITableViewCell on the top.

    Also make sure that button is a subview of the "Content View".

提交回复
热议问题