不使用tableView更改UITableView节头:titleForHeaderInSection [英] Changing UITableView section header without tableView:titleForHeaderInSection
问题描述
当我选择该部分的单元格时,我正在尝试更改 UITableView
中某个部分的标题标题。 tableView:titleForHeaderInSection
由应用程序触发,因此无济于事。我可以调用 reloadData
,但性能会受到影响,因为应用程序必须重新加载所有可见单元格。我也尝试使用自定义标头,但这也会导致一些性能问题。
I'm trying to change the header title for a section in a UITableView
when a cell from that section is selected. tableView:titleForHeaderInSection
is triggered by the application, so that doesn't help. I can call reloadData
, but the performance suffers because the app has to reload all the visible cells. I also tried to use a custom header, but that also results in some performance problems.
有没有办法获得 UILabel
的句柄,默认标题视图使用并手动更改其文本?
Is there any way to get a handle to the UILabel
that the default header view uses and change its text manually?
谢谢!
推荐答案
似乎没有用于访问系统提供的节头视图的标准API。你有没有尝试过更有针对性的 reloadSections:withRowAnimation
让UIKit显示新的标题文本?
There doesn't appear to be any standard API for accessing the system-provided section header view. Have you tried the more targeted reloadSections:withRowAnimation
to get UIKit to display the new header text?
您在自定义部分标题视图中看到了哪些性能问题?我怀疑标准的不仅仅是 UILabel
。
What kind of performance issues were you seeing with custom section header views? I doubt that the standard one is much more than just a UILabel
.
这篇关于不使用tableView更改UITableView节头:titleForHeaderInSection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!