gpt4 book ai didi

swift - 表格 View 中的部分名称

转载 作者:可可西里 更新时间:2023-10-31 23:58:10 26 4
gpt4 key购买 nike

如何获取文本字段的文本,并将其作为表格 View 中的一个部分的名称?我想在 Swift 和 Xcode 6 中执行此操作。非常感谢。

最佳答案

您可以使用titleForHeaderInSection

func tableView(tableView: UITableView!, titleForHeaderInSection section: Int) -> String!{
if (section == 0){
return textfield.text
}
if (section == 1){
return textfield2.text
}
}

关于swift - 表格 View 中的部分名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28139616/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com