- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsMake(0, 15*kRating, 0, 15*kRating)];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsMake(0, 15*kRating, 0, 15*kRating)];
}
// 隐藏每个分区最后一个cell的分割线
if (indexPath.row == [tableView numberOfRowsInSection:indexPath.section]-1)
{
// 1.系统分割线,移到屏幕外
cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, cell.bounds.size.width);
}
}
网友评论