【发布时间】:2020-03-31 23:10:05
【问题描述】:
堆栈溢出流。
我知道这些页脚可能*有很多方法可以在单元格下制作标签作为已知页脚。
我知道如何使用 index.row 创建页脚,它允许您使用数组自动标题、图像和所有内容,否则页脚不会?
我正在尝试在 iOS 13 中设置样式等部分下制作标题。
资源代码:
当您创建一个数组以提供自动单元格时。
class SettingViewController: UIViewController {
var settingtitle = ["Item1", "Item2", "Item3"]
var footerTitle = ["Footer1", Footer2", Footer3"]
@IBOutlet weak var TableView: UITableView!
}
现在是时候使用 Delegate 和 Data Source 构建 UITableView 了。
extension SettingViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return settingtitle.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cells = TableView.dequeueReusableCell(withIdentifier: "Cells", for: indexPath) as? SettingTableViewCell
cells?.Setting_Title.text = settingtitle[indexPath.row]
return cells!
}
}
但是我怎样才能将标签与数组一起上传到单元格下方?
我尝试了许多解决堆栈溢出的方法,但我注意到他们的一种方法有效,但它显示在整个单元格的一个页脚下。
感谢您对这个问题的帮助。 如果你知道,请告诉我。
【问题讨论】:
标签: arrays swift uitableview uilabel footer