有没有一种方法可以强制刷新UITableView中的单个标头? [英] Is there a way to force a refresh of just a single header in UITableView?
问题描述
我有一个UITableView,我想在其中强制刷新特定节头行,而不是数据行.例如,刷新第3节的标题.我知道如何重新加载整个节(标题和数据),但是能否刷新节标题?
当数据在表的一个部分中更改时,我想更新DIFFERENT部分的标题中的信息.因此,我需要获取对节标题的引用,然后刷新它.
如果标头是自定义的UIView
,则只需在UIView
而不是UITableView
上调用setNeedsDisplay
.>
I have a UITableView where I want to force a refresh of just a specific section header row, not the data rows. For example, refresh the header for section 3. I know how to reload an entire section (header plus data), but can just the section header be refreshed?
EDIT: When data changes in one section of the table I want to update information in the header of a DIFFERENT section. Therefore, I need to get a reference to the section header and then refresh it.
If the header is a custom UIView
, then you can just call setNeedsDisplay
on the UIView
rather than on the UITableView
.
这篇关于有没有一种方法可以强制刷新UITableView中的单个标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!