didSelectRowAtIndexPath: not being called

前端 未结 14 2221
轻奢々
轻奢々 2020-11-29 18:57

I have a UITableView as a subview of my UIScrollVIew, which is the main view controlled by my MainViewController.

In MainView

14条回答
  •  离开以前
    2020-11-29 19:09

    My case is strange. My tableView has 2 sections. 1st section's cells work fine about tableView:didSelectRowAt:, but 2nd section's cells doesn't trigger didSelectRowAt:.

    The above problem happens at iPhone 4s, iOS 9.3. But in iPhone 5s, iOS 10.3, there are no problems, those cells works fine. It seems like iOS 9 bugs about UITableView.

    After many tests, I found out one line codes produces this bug.

    tableView.estimatedSectionHeaderHeight = 60.0
    

    Because the 2nd sections has no header view. I remove this line, and all works fine.

提交回复
热议问题