2019-11-07-0002:

2019-11-07  本文已影响0人  footSInRoad

1: //横线到最左边1

    if ([  self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {

        // 如果tableView响应了setSeparatorInset: 这个方法,我们就将tableView分割线的内边距设为0.

        [  self.tableView setSeparatorInset:UIEdgeInsetsZero];

    }

    if ([ self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {

        // 如果tableView响应了setLayoutMargins: 这个方法,我们就将tableView分割线的间距距设为0.

        [  self.tableView setLayoutMargins:UIEdgeInsetsZero];

    }

//pragma mark 横线到最左边2

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

    if ([cell respondsToSelector:@selector(setSeparatorInset:)])

    {

        [cell setSeparatorInset:UIEdgeInsetsZero];//UIEdgeInsetsMake(0, 0, 0, 15)

    }

    if ([cell respondsToSelector:@selector(setLayoutMargins:)])

    {

        [cell setLayoutMargins:UIEdgeInsetsZero];

    }

}

2:BasicDemo 说不定里面有你想要的东西 下载 线程 面试

上一篇 下一篇

猜你喜欢

热点阅读