【发布时间】:2020-01-01 22:28:36
【问题描述】:
所以我有一个 UITableView 和一个自定义 UITableViewCell,它有自己的自定义子视图。
在 iOS 12 中,上面的自定义子视图可以被触摸,它不会选择整个 Table View Cell。
在 iOS 13 Beta 中,触摸自定义子视图也会突出显示/选择整个表格视图单元格。
final class myTableView: UITableViewController {
.......
override final func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
//Do things for table view cell selection
}
.......
}
final class CustomChildView : UIView {
........
override final func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
{
super.touchesBegan(touches, with: event)
//Do touch down things
}
........
}
有没有办法在自定义子项被触摸时取消表格视图单元格的选择?
【问题讨论】:
标签: ios xcode uitableview uiview uitouch