ios - 多选模式下的 UITableView 删除所选单元格中所有 subview 的背景颜色

标签 ios swift uitableview

多选模式下的 UITableView 会删除所选单元格中所有 subview 的背景颜色。我不想更改 subview 的背景颜色,只是在选择上显示刻度线。我尝试将单元格的“selectedBackgroundView”和“multipleSelectionBackgroundView”分配给透明 View ,但它不起作用。我还尝试在单元格的“setEditing”和“setHighlighted”函数中重新分配 subview 的背景,但它也不起作用。还有其他方法可以解决这个问题吗?

enter image description here

最佳答案

在属性检查器中将 tableView 单元格选择设置为 None,或在代码中设置 cell.selectionStyle = .None

关于ios - 多选模式下的 UITableView 删除所选单元格中所有 subview 的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38421820/

相关文章:

ios - fatal error : unexpectedly found nil while unwrapping an Optional value while filtering

objective-c - cocos2d mac应用程序启动时如何添加启动画面(Default.png)

ios - UIButton 单击事件在自定义 UITableViewCell 内多次调用

swift - 使用 Swift 进行 SKPhysicsContactDelegate 碰撞检测

ios - cellForRow At IndexPath 执行一次太少?

iphone - 当我使用 2 个 TableView 时,如何将数据(托管对象)从一个 TableView 移动到另一个 TableView ?

ios - 在没有互联网时防止 JSONSerialization 崩溃我的应用程序的最佳方法?

ios - Root View Controller 偶尔丢失

ios - 在 CollectionView 标题单元格中访问 SearchBar - Swift

swift - 显示具有编程约束的按钮