I set:
cell.selectionStyle = UITableViewCellSelectionStyleGray;
and use the code to highlight a row:
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection: 0];
[self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone
The highlight color always blue even I set to gray. If I set:
cell.selectionStyle = UITableViewCellSelectionStyleNone;
it works fine and no highlight. But just not work with:
cell.selectionStyle = UITableViewCellSelectionStyleGray;
It just show blue color instead of gray color. Any idea? Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…