不用画线 设置UITableView的全屏分隔线

 

 

如图  添加如下代码

 

    sTableView.separatorInset = UIEdgeInsetsZero;

    sTableView.layoutMargins = UIEdgeInsetsZero;

    cell.layoutMargins = UIEdgeInsetsZero;

 

第二种方法如下图   

-(void)viewDidLayoutSubviews

{

    

    [super viewDidLayoutSubviews];

    

    if ([_moreTableView respondsToSelector:@selector(setSeparatorInset:)]) {

        [_moreTableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];

    }

    

    if ([_moreTableView respondsToSelector:@selector(setLayoutMargins:)]) {

        [_moreTableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)];

    }

}

 

 

-(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];

    }

    

}

 

 

 

少于150字不让发候选区   那我就多打点字吧。啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 

 

posted @ 2016-04-13 09:24  iOS张文权  阅读(403)  评论(0编辑  收藏  举报