UITableView separator line disappears when selecting cells in iOS7

后端 未结 24 2082
耶瑟儿~
耶瑟儿~ 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条回答
  •  渐次进展
    2020-12-05 04:25

    this solution will not help anybody who isn't using a backgroundView on his cells, anyway:

    - (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
        {
            [cell setBackgroundColor:[UIColor grayColor]];
        }
    

    this way the annoying visual effect is vastly reduced without having to reload the table. of course, you can change grayColor with anything which helps you improve the result in your case

提交回复
热议问题