I have set a UITableView's line separator style and colour in IB, however, when the table loads the separator lines are not visible.
I am using a UITableView which has a custom superclass CustomTableView - this is a subclass of UITableView. In this table, I am also using a custom UITableViewCell.
The only issue I could think it would be is if I didn't call the 'super' implementation in my awakeFromNib method - but I do this so it can't be that.
Any ideas?
EDIT with code
My table cell is as follows - CustomDefaultCell.h > CustomPlainCell.h > UITableViewCell
CustomDefaultCell.m
- (void)awakeFromNib
{
[super awakeFromNib];
// Called when loaded from a nib.
// Override all default cell behaviour here.
//
}
CustomPlainCell.m
- (void)awakeFromNib
{
[super awakeFromNib];
// Called when loaded from a nib.
// Override all default cell behaviour here.
//
// Normal background view
self.backgroundView = [[UIView alloc] initWithFrame:self.frame];
self.backgroundView.backgroundColor = [UIColor whiteColor];
// Selected background view
self.selectedBackgroundView = [[UIView alloc] init];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
//
// Background gradient
CAGradientLayer *selectedViewGradientLayer = [CAGradientLayer layer];
selectedViewGradientLayer.frame = CGRectMake(1.0f, 0.0f, 320.0f, CGRectGetHeight(self.frame) + 1.0f);
selectedViewGradientLayer.colors = @[(id)[UIColor colorWithHue:0.0f saturation:0.0f brightness:0.57f alpha:1.0f].CGColor, (id)[UIColor grayColor].CGColor];
[self.selectedBackgroundView.layer addSublayer:selectedViewGradientLayer];
}