@implementation TestTableViewCell
-(void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
self.selectedBackgroundView = [[UIView alloc] init];
}
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
[super setHighlighted:highlighted animated:animated];
if(highlighted || self.selected)
{
self.labelTest.tintColor = self.tintColor;
self.labelTest.text = @"HighLighted";
}
else
{
self.labelTest.tintColor = [UIColor redColor];
self.labelTest.text = @"Not HighLighted";
}
}
@end
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
tableView.separatorColor = [UIColor redColor];
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
TestTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"testCell"];
if (indexPath.row == 5) {
[tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
}
return cell;
}
This is my code. If the row is 5 programmatically select the cell using selectRowAtIndexPath. When I do this, the tableseperator is missing in 7.1 But the same code works fine in 7.0
Not sure why the separator is missing in 7.1