UITableView separator line disappears when selecting cells in iOS7

后端 未结 24 2051
耶瑟儿~
耶瑟儿~ 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:20

    - cellForRowAtIndexPath

    Create two separator views (sv1, sv2)
    
    [cell addsubview:sv1];
    [cell.selectedBackgroundView addsubview:sv2];
    

    - didSelectRowAtIndexPath

    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    

提交回复
热议问题