I have a UITableView and have set multiple selection while editing to true
tableView.allowsMultipleSelectionDuringEditing = true
In the cell configuration (cellForRowAtIndexPath), I do:
cell.selectionStyle = .default
cell.accessoryType = .checkmark
So when tableView is set to editing mode, I get blue checkmark option on the left side. I want to change the default blue color on that accessory. How do I do that?
In your custom UITableViewCell
, set cell's
tintColor
in awakeFromNib()
like so,
class CustomCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
self.tintColor = .red
}
}
Just set the cell tint color whatever you want. It will automatically change the accessory type color.
[cell setTintColor:[UIColor whiteColor]];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.