怎么为tableview添加header

如题所述

第1个回答  推荐于2016-03-10
- (UIView *)tableView:(UITableView *)tableView
viewForHeaderInSection:(NSInteger)section{
UIView *v_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 23)];//创建一个视图(v_headerView)
UIImageView *v_headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 23)];//创建一个UIimageView(v_headerImageView)本回答被提问者和网友采纳