iOS9 - UITableViewCellContentView is covering up Controls inside Cell

前端 未结 4 1708
生来不讨喜
生来不讨喜 2021-02-02 14:02

I have made a custom UITableViewCell called \"SwitchCell\" that has a switch. In iOS9 Only, using Xcode 7 beta, the Content view in the cell is on top of the switch. (See scre

4条回答
  •  清歌不尽
    2021-02-02 14:30

    SWIFT

    I had an issue where my buttons in my custom tableviewcell swift files were working just fine, but then I upgraded to Xcode 12 and then all of a sudden I couldn't access them anymore (meaning my taps were not being recognized). The cell content view seemed to be interfering in the hierarchy and this like saved me:

    cell.contentView.isUserInteractionEnabled = false
    

    I put the line in cellForRowAt.

    Thank you to @FranticRock

提交回复
热议问题