0

UITableViewCell default effect, when the cell is pressed, the cell will get gray background.The UITableViewCell child view control will also change the background color. How to let the child views background doesn't change?

Pang
  • 9,564
  • 146
  • 81
  • 122
ChildrenGreens
  • 119
  • 1
  • 9
  • Similar to this question http://stackoverflow.com/questions/26895370/swift-uitableviewcell-selected-background-color-on-multiple-selection?rq=1 – muneeb Apr 15 '16 at 00:51
  • I look at the website you provide, the effect is not what I want.But still want to thank you. – ChildrenGreens Apr 16 '16 at 03:13

2 Answers2

0

This may be suitable for you:

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
Pang
  • 9,564
  • 146
  • 81
  • 122
Jeremy
  • 1
0

Use this code,

let cell:UITableViewCell = UITableViewCell(style:UITableViewCellStyle.Default, reuseIdentifier:"cell")

cell.selectionStyle = UITableViewCellSelectionStyle.None
return cell

hope its helpful

Iyyappan Ravi
  • 3,205
  • 2
  • 16
  • 30