I have a TableView in my app, and I needed to change the height and the color of the Separator. Browsing here in SO helped me to figure out the solution.
So I’m basically adding a UIView in my cell and using this as a “fake” separator:
UIView *colorSeparator = [[UIView alloc] initWithFrame:CGRectMake(0, 53, cell.frame.size.width, 4)];
colorSeparator.backgroundColor = [UIColor yellowColor];
[cell.contentView addSubview:colorSeparator];
[colorSeparator release];
But now I noticed that when the row is tapped, the selection colour applies to my fake separator. Does anyone know how could avoid it? Thx in advice for your time 🙂
You can restore color of your separator in
setSelected:animated:andsetHighlighted:animated:methods of UITableViewCell.