您的位置:首页 > 产品设计 > UI/UE

UITableViewStyleGrouped的间距问题

2016-05-05 15:52 549 查看
[UITableView
alloc]initWithFrame:CGRectMake(。。。。)
style:UITableViewStyleGrouped];

UITableViewStyleGrouped,section的间距由footer和header组成,调整footer和header的大小就可以了。

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

    if (section == 0) {

        

    UIView *view = [[UIView
alloc]initWithFrame:CGRectMake(0, 0,
SCREEN_W, 100)];

  //。。。。。。

    

    return view;

    }

    return
nil;

}

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

    return
nil;

}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{

   

    return section == 0 ? 100 : 1;

    

}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{

    return 1;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: