-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
// 三个方法并用,实现自定义分割线效果
UIEdgeInsets edge = UIEdgeInsetsMake(0, 20, 0, 0);
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:edge];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:edge];
}
if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
[cell setPreservesSuperviewLayoutMargins:NO];
}
}

被折叠的 条评论
为什么被折叠?



