用
self.tableView.sectionHeaderHeight = 35 self.tableView.sectionFooterHeight = 0
设置的高度 第一个section 含有标题时 高度会比其它含有title的section高
使用 TableViewDelegate 协议里面的一个方法替换
override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 30
}
所有高度就都一样了
footer应该是同理
override func tableView(tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
原文:http://www.cnblogs.com/baaingSheep/p/4758909.html