2013-08-18 56 views
8

我有一個tableview,我想重新加載(和改變高度)只是sectionHeader而不是本節內的單元格。我想這樣做的原因是因爲我用標題中的動畫漸變,就像這樣:UITableview重新加載SectionHeader,但不是單元格在

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

但在同一時間,我在這一節中添加細胞與

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

我我希望能夠爲正在添加的單元格保留UITableViewRowAnimationRight,但是當我重新加載該部分時,淡入淡出的動畫會應用到整個部分。有什麼方法可以重新加載sectionHeader,而不是部分中的單元格?

回答

6

只需創建2個獨立的

[tableView beginUpdates]; 
[tableView endUpdates]; 

括號兩個插入/變更。

+0

這是行不通的。 – Andy

+0

也許你的設置是不同的。 – Mundi

+0

我的設置是普通的FRC + TVC。唯一有用的是抓取標題視圖並手動更新它們。 – Andy

相關問題