UITableView设置Section间距

//section头部间距
- (CGFloat)tableView:(UITableView )tableView heightForHeaderInSection:(NSInteger)section
{
return 1;//section头部高度
}
//section头部视图
- (UIView
)tableView:(UITableView )tableView viewForHeaderInSection:(NSInteger)section
{
UIView
view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 1)];
view.backgroundColor = [UIColor clearColor];
return view ;
}
//section底部间距
- (CGFloat)tableView:(UITableView )tableView heightForFooterInSection:(NSInteger)section
{
return 1;
}
//section底部视图
- (UIView
)tableView:(UITableView )tableView viewForFooterInSection:(NSInteger)section
{
UIView
view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 1)];
view.backgroundColor = [UIColor clearColor];
return view;
}

文/代码干货(简书作者)
原文链接:http://www.jianshu.com/p/7364a11e1fc2
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
posted @ 2016-07-22 13:53  樊特西style  阅读(3585)  评论(0编辑  收藏  举报