设置headView需要两个函数

来源:互联网 发布:外卖哪个软件便宜 编辑:程序博客网 时间:2024/06/11 08:56
  • (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 50;
    }

  • (UIView )tableView:(UITableView )tableView viewForHeaderInSection:(NSInteger)section{
    UIView *cusheadView = [[UIView alloc]initWithFrame:CGRectMake(0,0, SCREEN_WIDTH, 50)];
    cusheadView.backgroundColor = [UIColor greenColor];
    return cusheadView;
    }

0 0
原创粉丝点击