I want to omit the separation line between two tableview cells. But instead of no separator I get a separation line of height 1 pixel that is simply left blank or better said completly transparent.
How can I tell the uitableview how to attach the next cell directly to the cell above (without any gap)?
Ok, found the answer for mine and sharing it just incase it helps others.
I set all my cells up procedurally so I turned off the separator via
m_tableView setSeparatorColor:[UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.0f]]
next I set the separator style via
m_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
although I have to admit that didn't seem to do anything and this might be a redherring.
For me I found that cellForRowAtIndexPath was called to configure the cell and I had to extend my background image by 1 pixel in height to get rid of the line (I am using a stretchable image for this too which might also be lending itself to the bizarre +1 requirement). I'm not a fan of arbitary +1's but this seemed to do the trick...
frameBackground.size.height += 1;
so whilst not endorsing a +1 the above steps have worked for my listview and now no longer have a separator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With