uitableview最后一个cell的separator line顶头

  1. storyboard
    选中tableviewcell,选择separator为custom insets,left为0
uitableview最后一个cell的separator line顶头_第1张图片
image.png
  1. 纯代码
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
    [cell setSeparatorInset:UIEdgeInsetsZero];
    }

    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
    [cell setLayoutMargins:UIEdgeInsetsZero];
    }

    if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
    [cell setPreservesSuperviewLayoutMargins:NO];
    }

你可能感兴趣的:(uitableview最后一个cell的separator line顶头)