UITableView separator line disappears when selecting cells in iOS7

后端 未结 24 2103
耶瑟儿~
耶瑟儿~ 2020-12-05 04:01

In my tableView I set a separator line between cells. I am allowing selection of multiple cells. Here\'s my code for setting selected cell background color:

         


        
24条回答
  •  Happy的楠姐
    2020-12-05 04:30

    This problem exists for single cell selection as well.

    Another solution is to reload the table view, select followed by deselect:

    self.selectedIndex = inIndexPath.row;
    [inTableView reloadData];
    [inTableView selectRowAtIndexPath:inIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
    [inTableView deselectRowAtIndexPath:inIndexPath animated:YES];
    

    This gets rid of a subtle graphical selection glitch I saw in Mark's solution.

提交回复
热议问题