0

As a UITableView is allowsMultipleSelectionDuringEditing = true,

the default selection style is a light-blue look on a selected cell:

enter image description here

I set the cell contentView.backgroundColor = .whiteColor() when the cell got highlighted/ selected,

consequently make the circle-checkmark area remain light-blue but not the whole cell:

enter image description here

TL;DR

I need the whole cell to be white as it's multiple-selected, which means I cannot set the cell's selectionStyle = .None.

Is there a way to achieve this?

bluenowhere
  • 2,683
  • 5
  • 24
  • 37
  • fake it by adding labels in a separate view and set that view's background color as white .And keep the selection color default for – Muhammad Adnan Jul 21 '16 at 09:17
  • 1
    You can set your custom view as a selectedBackgroundView of a cell. In custom cell class, simply you can write this code self.selectedBackgroundView = UIView(frame: rect) self.selectedBackgroundView?.backgroundColor = UIColor.whiteColor() Hope this may solve your issue. – dev_binod Jul 21 '16 at 09:40
  • @iOS_Binod works like a champ! – bluenowhere Jul 26 '16 at 02:21

1 Answers1

-1

Have you tried cell.backgroundColor = UIColor.whiteColor() ?

Juri Noga
  • 4,363
  • 7
  • 38
  • 51