【问题标题】:Reload header in section without reloading section rows in swift在节中重新加载标题而不在 swift 中重新加载节行
【发布时间】:2018-12-30 17:48:49
【问题描述】:

我正在尝试重新加载 UITableView 部分标题,而不是重新加载整个部分的行,因为我在行中有一个 UITextfield,当我调用 tableview reloadSections 时,它清除了文本字段值。

【问题讨论】:

  • 反过来想:将文本字段的值保存在数据模型中。

标签: ios swift uitableview uitableviewrowaction uitableviewsectionheader


【解决方案1】:
let sectionIndex = IndexSet(integer: 0)
self.tableView.reloadSections(sectionIndex, with: .none)

您可以使用此代码重新加载表格视图。您无需重新加载标题即可显示项目

【讨论】:

    【解决方案2】:

    你可以使用,

    tableView.beginUpdates()
    tableView.endUpdates()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-21
      • 1970-01-01
      • 1970-01-01
      • 2020-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多