gpt4 book ai didi

ios - 在函数 cellForRowAt 中访问静态单元格的 detailTextLabel

转载 作者:行者123 更新时间:2023-11-28 10:14:21 24 4
gpt4 key购买 nike

我有一个设置 View ,当我点击某个单元格时,我进入了一个新 View ,在第二个 View 中我更改了一些设置,当我返回设置 View 时,我重新加载我的 tableView 因为我想改变detailTextLabel,我不明白如何使用静态表调用 cellForRowAt()。

TableViewStaticCell

在红色部分,我想在 cellForRowAt() 的每一轮中用数据数组填充它。 My TableView

最佳答案

如果您想从某些数据(例如数组)填充单元格。然后单元格不是静态的,需要更改为原型(prototype)单元格。

然后,您为单元格创建一个重用标识符,并在 cellForRow 方法中使用重用标识符使该单元格出队,并从您的数据源设置 detialTextLabel 文本,例如:cell.detailTextLabel.text = myArray[indexPath.row ].settingName.

关于ios - 在函数 cellForRowAt 中访问静态单元格的 detailTextLabel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43318719/

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