iOS9 - UITableViewCellContentView is covering up Controls inside Cell

前端 未结 4 1742
生来不讨喜
生来不讨喜 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:29

    After more investigation and searching, i found my solution here: Button in UITableViewCell not responding under ios 7

    What fixed it for me was: cell.contentView.userInteractionEnabled = NO;

    This prevents the cell content view from taking over the touch events, even though it's on top of the other views.

    This issue was not only happening on iOS9, but on iOS7 as well. In iOS8, the Content view was behind the controls.

提交回复
热议问题