TableView使默认下划线从最左边开始

   //创建tableView时添加
    if ([tableV respondsToSelector:@selector(setSeparatorInset:)]) {
        [tableV setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([tableV respondsToSelector:@selector(setLayoutMargins:)]) {
        [tableV setLayoutMargins:UIEdgeInsetsZero];
    }

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
}



版权声明:本文为CrazyDony原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。