这是我的代码:
cell.accessoryType = UITableViewCellAccessoryType.Checkmark
但是当我运行该应用程序时,我看不到复选标记。
然后我将背景颜色设置为黑色,我可以看到一个白色的复选标记。
如何将复选标记的颜色更改为蓝色等其他颜色?
最佳答案
是的,你可以做到。
只需设置单元格的tintColor
即可。
cell.tintColor = UIColor.whiteColor()
cell.accessoryType = UITableViewCellAccessoryType.Checkmark
swift 3
let aCell = tableView.dequeueReusableCell(withIdentifier: "Cell")!
aCell.tintColor = UIColor.red
aCell.accessoryType = .checkmark
return aCell
您也可以从 Attributes Inspector 中执行此操作
关于swift - 如何更改 UITableViewCellAccessoryType.Checkmark 的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30762863/