I had this issue in a somewhat different situation though, my cells are in editing mode but it shouldn't matter. In my case I didn't want the bottom _UITableViewCellSeparatorView
showing after selecting a cell so after looking through the subviews of the cell NSLog(@"%@", [cell.subviews[0] subviews]);
I seen
(
"<_UITableViewCellSeparatorView: 0x9df7f30; frame = (0 99; 280 1); layer = <CALayer: 0x9dfb800>>",
"<UITableViewCellContentView: 0x9d65950; frame = (38 0; 242 99.5); opaque = NO; gestureRecognizers = <NSArray: 0x9d2e0d0>; layer = <CALayer: 0x9de8290>>",
"<_UITableViewCellSeparatorView: 0x9dfab90; frame = (0 99.5; 280 0.5); layer = <CALayer: 0x9dfb7d0>>",
"<UITableViewCellEditControl: 0x9df3f60; frame = (0 0; 47 100); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x9d91370>>",
"<UIView: 0x9df4470; frame = (0 98; 280 3); layer = <CALayer: 0x9df44d0>>",
"<UIView: 0x9d35f10; frame = (0 98; 280 3); layer = <CALayer: 0x9d39e20>>"
)
which made it easier to find and get rid of the annoying separator views by using this
[[[cell.subviews[0] subviews] objectAtIndex:2] setBackgroundColor:[UIColor clearColor]];
For some reason I don't have an issue with the top separator view, most likely because my header in each section has a dark background color that hides the separator view but if you wanted to cover them up you could probably add this code
[[[cell.subviews[0] subviews] firstObject] setBackgroundColor:[UIColor clearColor]];
Note that I put this code within my didHighlightRowAtIndexPath
delegate. In addition, my cells selectionStyle
is set to default. Hope this helps someone out there!