设为首页 加入收藏

TOP

不用画线 设置UITableView的全屏分隔线
2017-10-13 10:17:04 】 浏览:6327
Tags:不用 设置 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字不让发候选区   那我就多打点字吧。啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 啦啦啦 

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇iOS 学习 - 5.UILabel设置行距 下一篇核心动画——弹簧动画二

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目