簡體   English   中英

UITableview重新加載SectionHeader,但不重新加載section中的單元格

[英]UITableview reload SectionHeader but not cells in section

我有一個tableview,我只想重新加載(並更改其高度)sectionHeader,而不要重新加載此部分中的單元格。 我想要這樣做的原因是因為我在標題上使用了淡入淡出動畫,如下所示:

[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0]   
    withRowAnimation:UITableViewRowAnimationFade];

但與此同時,我在該部分中添加了一個單元格,

[self.tableView insertRowsAtIndexPaths:
    @[[NSIndexPath indexPathForRow:0 inSection:0]]
    withRowAnimation:UITableViewRowAnimationRight];

我希望能夠為要添加的單元格保留UITableViewRowAnimationRight ,但是當我重新加載Section時,淡入淡出動畫將應用於整個section。 有什么方法可以重新加載sectionHeader,而不是部分中的單元格嗎?

只需創建2個單獨的括號即可

[tableView beginUpdates];
[tableView endUpdates];

對於兩次插入/更改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM