tableView的设置

TableView的设置

1.设置table头部和底部的view

// 底部(宽度固定是320

tableView.tableFooterView = footer;

// 头部(宽度固定是320

tableView.tableHeaderView = header;

2.设置每一组头部和底部的高度

tableView.sectionHeaderHeight = 5;

tableView.sectionFooterHeight = 0;

3.设置tableView的背景

// tableview的样式为group时,如果想更换背景,必须清除默认条纹状的backgroundView

// backgroundView的优先级 > backgroundColor

tableView.backgroundView = nil;

tableView.backgroundColor = [UIColor redColor];

原文地址:https://www.cnblogs.com/changxs/p/3440543.html