ios - swift 3 : UITableViewCell disable selection style also disables selection

标签 ios swift uitableview swift3

我的 tableview 单元有一个严重的问题。所以这是场景:

  1. 在 TableView 中进入编辑模式
  2. 出现缩进复选标记,我喜欢通过点击来选择单元格 没有蓝色/灰色/任何选择样式。

我做了什么:

表格 View :

self.tableView.allowsSelectionDuringEditing = true
self.tableView.allowsMultipleSelectionDuringEditing = true

单元格:

self.selectionStyle = .none -> Results in no longer selectable cells

期望:

左边的复选标记没有该死的蓝色边框/灰色背景。

结果:

背景 View 可见,这会杀死单元格 subview (蓝色背景消失,白色文本不再可见等)

我已经测试但没有任何积极结果的内容:

Cell.appearence().selectedBackground.color = UIColor.clear

cell.selectedBackground.color = UIColor.clear

override var isSelected:... within the cell

也许你有什么想法。

最佳答案

试试这个:

Cell.selectionStyle = UITableViewCellSelectionStyle.none

关于ios - swift 3 : UITableViewCell disable selection style also disables selection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42084532/

相关文章:

iOS 应用程序升级后无法启动

ios - 单击表格 View 单元格时转到另一个 View

ios - UISwipeGestureRecognizer 未添加到 View 中

ios - 如何在 UITableView 的编辑模式下不显示 "-"删除按钮?

uitableview - 子类 uitableviewcell subview 颜色

ios swift - 返回到隐藏导航栏的屏幕时,导航项背景变黑

ios - 应用模糊渐变

swift - 如何在 Swift 中对具有不同值的数组进行分组?

json - 从 JSON 解码为自定义对象

ios - 无法根据 ios 中的标签文本更改正确的 UITableViewCell 高度