我正在开发一个外卖应用程序,在一个商店里,我有多个菜单类别。我有一个单一的表视图中的项目。因此,当我到达每个部分的标题(例如,早餐,然后早餐选项卡应处于活动状态)时,如何相应地更改选项卡?enter image description here
发布于 2019-12-25 19:51:25
使用这两种方法将标题放入节中..
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return "Section \(section)"
}
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let vw = UIView()
vw.backgroundColor = UIColor.red
return vw
}https://stackoverflow.com/questions/59478082
复制相似问题