func tableView(tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
//2是最后一行
if section == 2{
return 10
}else{
return 0
}
}
func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let sectionHeader = UIView(frame: CGRectMake(0, 0, view.frame.width, 10))
//这个颜色和tableview背景颜色一样
sectionHeader.backgroundColor = UIColor(red: 0.97, green: 0.97, blue: 0.97, alpha: 1.0)
return sectionHeader
}
如果不行,就把Footer换成header,多添加一个selection,这个我试过,行