UITableViewCell Separator disappearing in iOS7

前端 未结 30 769
轮回少年
轮回少年 2020-12-07 08:31

I have some strange issue with UITableView only in iOS 7.

UITableViewCellSeparator disappears above the first row and below the last row. S

30条回答
  •  悲&欢浪女
    2020-12-07 09:07

    You need to remove a cell selection before you doing cell's update. Then you could restore selection.

    NSIndexPath *selectedPath = [self.tableview indexPathForSelectedRow];
        [self.tableview deselectRowAtIndexPath:selectedPath animated:NO];
        [self.tableview reloadRowsAtIndexPaths:@[ path ] withRowAnimation:UITableViewRowAnimationNone];
        [self.tableview selectRowAtIndexPath:selectedPath animated:NO scrollPosition:UITableViewScrollPositionNone];
    

提交回复
热议问题