自定義一個headerView
self.tableView.tableHeaderView=self.headerView;
這個headerView 會有一個默認的背景顏色,搞了好久都沒找到,在哪設(shè)置,在 xcode 發(fā)現(xiàn)多出一個控件uitableviewheaderfooterview
然后在看到文章:http://blog.csdn.net/liwenjie0912/article/details/41806243
在設(shè)置一個透明的背景顏色,發(fā)現(xiàn)不行
- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section
經(jīng)過研究看到 tableview 的方法,在這里設(shè)置顏色透明就搞定了.
- (void)tableView:(UITableView*)tableView willDisplayHeaderView:(UIView*)view forSection:(NSInteger)section {
view.tintColor= [UIColorclearColor];
}