其他代理方法的使用
1、组标题设置
// 组头标题
optional public func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? // fixed font style. use custom view (UILabel) if you want something different // 固定的字体样式,想要做一些不同的就使用自定义视图
// 组尾标题
optional public func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String?
代码体现
/* 使用这种方式设置的组头和组尾标题的字体样式都是统一的,不能进行自定义 */
// 设置组头标题
func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return "\(section)组组头"
}
// 设置组尾标题
func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? {
return "\(section)组组尾"
}
效果图
Snip20160602_28.png