UITableView 的头视图和分区视图

427 阅读1分钟

tableView的头视图:

UIView*tableHeaderView = [[UIViewalloc]initWithFrame:CGRectMake(0,0,HZScreenW,kP(760))];

tableHeaderView.backgroundColor= [UIColorgreenColor];

self.tableView.tableHeaderView= tableHeaderView;

tableView的分区视图:

- (UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section {

return[UIViewnew];

}