自定義一個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];
}