TableView 多余分割线的处理


方法一,以下两个方法的实现

- (void)viewDidLoad {

    [super viewDidLoad];

    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];    

}

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section{

    UITableViewHeaderFooterView *footer = (UITableViewHeaderFooterView *)view;

    footer.contentView.backgroundColor = [UIColor colorWithRed:237/255.0 green:241/255.0 blue:250/255.0 alpha:1.0];

}

方法二,

在viewDidLoad中调用下面的方法,传入需要处理的tableView即可

-(void)setExtraCellLineHidden: (UITableView *)tableView

{

    UIView *view = [UIView new];

    view.backgroundColor = [UIColor clearColor];

    [tableView setTableFooterView:view];

}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM