自定义 tableView的header,让 header随着 cell滚动

自定义一个headerView

self.tableView.tableHeaderView=self.headerView;

这个headerView 会有一个默认的背景颜色,搞了好久都没找到,在哪设置,在 xcode 发现多出一个控件uitableviewheaderfooterview

然后在看到文章:http://blog.csdn.net/liwenjie0912/article/details/41806243

在设置一个透明的背景颜色,发现不行

- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section

经过研究看到 tableview 的方法,在这里设置颜色透明就搞定了.

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

view.tintColor= [UIColorclearColor];

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容