2013-10-17 24 views
0

我已經爲UITableView實現了自定義部分標題。它工作正常,除了當我在tableview中插入一節。然後它完全消失,如果我調試我可以看到自定義節頭的alpha屬性是0,我當然還沒有設置。自定義UITableView部分標題阿爾法0

這是在自定義頭消失我在做什麼:

[self.settingsTableView beginUpdates]; 

[self.settingsTableView insertSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade]; 

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

[self.settingsTableView endUpdates]; 

回答

0

重裝不應該叫內beginUpdatesendUpdates

0

我使用自定義標題時有完全相同的問題並返回本地伊娃實例。

問題是UITableView的期待爲您返回不同的看法:

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 

我覺得它認爲它有2點意見,並會設置透明度爲1和α爲0,以舊的。 ..但在我的情況下,「新的」仍然是錯誤的阿爾法。

的解決方案是隻實例化該視圖中爲第委託方法的新視圖。

相關問題