自定義 tableView的header,讓 header隨著 cell滾動

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

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容