29,031
社区成员
发帖
与我相关
我的任务
分享
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?{
let cellID = "headerCell"
var headerCell = tableView.dequeueReusableCellWithIdentifier(cellID)
as? HeaderCell
headerCell?.backgroundColor = UIColor.greenColor()
if(headerCell == nil){
headerCell = HeaderCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: cellID)
}
switch section {
case 0:
headerCell!.headerLabel.text = "模式"
break
case 1:
headerCell!.headerLabel.text = "风速"
break
default:
headerCell!.headerLabel.text = "other"
break
}
return headerCell!
}