美文网首页
改变UITableView头视图的背景色

改变UITableView头视图的背景色

作者: 阿木小丸子 | 来源:发表于2018-01-24 14:42 被阅读0次

1、当有自定义的头视图时:

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

    view.tintColor = [UIColor clearColor];

}

2、当没有自定义的头视图时:

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

{

    UITableViewHeaderFooterView *v = (UITableViewHeaderFooterView *)view;

    v.backgroundView.backgroundColor = [UIColor clearColor];

}

相关文章

网友评论

      本文标题:改变UITableView头视图的背景色

      本文链接:https://www.haomeiwen.com/subject/nyduaxtx.html