Вы можете настроить заголовок раздела, настроив UITableViewCell
в раскадровке.
Вы проектируете 3-ю секцию так же, как и снимок в раскадровке.
Вот пример двух раздела двух различных UITableView
клеток я
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
//Say 2 section with two different look
if section == 0{
let header = tableView.dequeueReusableCellWithIdentifier("HeaderTableViewCell1")! as! HeaderTableViewCell1
header._lblGroupName.text = ""
header._btnExpand.addTarget(self, action: "hideSection:", forControlEvents: .TouchUpInside)
header._lblTotalCount.text = ""
return header.contentView
}
else{
let header = tableView.dequeueReusableCellWithIdentifier("HeaderTableViewCell2")! as! HeaderTableViewCell2
header._lblGroupName.text = ""
header._btnExpand.addTarget(self, action: "hideSection:", forControlEvents: .TouchUpInside)
header._lblTotalCount.text = ""
return header.contentView
}
}
Создайте два пользовательских UITableViewCell
классов. Установите розетку
class HeaderTableViewCell1: UITableViewCell {
@IBOutlet weak var _lblTotalCount: UILabel!
@IBOutlet weak var _btnExpand: UIButton!
@IBOutlet weak var _lblGroupName: UILabel!
}
class HeaderTableViewCell2: UITableViewCell {
@IBOutlet weak var _lblTotalCount: UILabel!
@IBOutlet weak var _btnExpand: UIButton!
@IBOutlet weak var _lblGroupName: UILabel!
}
Опубликовать больше деталей, код или скриншот. – Lumialxk