【发布时间】:2015-06-11 10:54:23
【问题描述】:
在方法didSelectRowAtIndexPath我使用
selectedCell.accessoryType = .Checkmark
如何将复选标记的背景颜色更改为不同于灰色? 以及如何改变它的颜色: 当我按下单元格并且在触摸后没有触摸鼠标按钮时会发生这种情况,它会变成深蓝色
【问题讨论】:
标签: uitableview swift touch selection checkmark
在方法didSelectRowAtIndexPath我使用
selectedCell.accessoryType = .Checkmark
如何将复选标记的背景颜色更改为不同于灰色? 以及如何改变它的颜色: 当我按下单元格并且在触摸后没有触摸鼠标按钮时会发生这种情况,它会变成深蓝色
【问题讨论】:
标签: uitableview swift touch selection checkmark
灰色是因为您选择了单元格。 selectionStyle 默认为纯灰色,您没有做任何更改。不喜欢就换!如果您只想更改选择期间发生的情况,最简单的方法是为selectedBackgroundView 提供自己的backgroundColor。
【讨论】:
cellForRowAtIndexPath、willSelectRowAtIndexPath、didSelectRowAtIndexPath 中也尝试在属性检查器中使用 selectionStyle,但不起作用...selectedBackgroundView.backgroungColor = UIColor.redColor() 在cellForRowAtIndexPath 中也不起作用, didSelectRowAtIndexPath, willSelectRowAtIndexPath
selectedBackgroundView.backgroundColor?我之前告诉过你,我在willSelectRowAtIndexPath 和didSelectRowAtIndexPath 中设置了它,它不起作用!