我希望你能幫助我感到有點堅持到哪裏找的,我有這個UITableView的問題的解決方案切片的UITableView呈現毛刺在UITableView部分的頂部使用以下方法(請參閱下面的代碼),除了這個毛刺之外,它的所有工作都非常漂亮:部分頂部的插入行按預期呈現 - 在左上角和右上角都有圓角。麻煩的是,下面的行沒有在視覺上更新,即第二行/單元仍然有它的圓角,而現在它應該平方在它的頂角 - please see this screen grab for clarification動畫在第二部分的頂部插入一個新行後發生。查看單元格的角落,因爲它們尚未更新。iPhone:</p> <p>當我插入一個新項目:與insertRowsAtIndexPaths
// Amend the data source before updating the view to reflect the changes
[[self.playerData objectAtIndex: 0] removeObjectAtIndex: row];
[[self.playerData objectAtIndex: 1] insertObject:playerName atIndex:0];
// Amend the view to reflect changes
NSArray *deleteIndexPaths = [NSArray arrayWithObjects:
[NSIndexPath indexPathForRow:row inSection:0],
nil];
NSArray *insertIndexPaths = [NSArray arrayWithObjects:
[NSIndexPath indexPathForRow:0 inSection:1],
nil];
[self.playerTableView beginUpdates];
[self.playerTableView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation: UITableViewRowAnimationLeft];
[self.playerTableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation: UITableViewRowAnimationLeft];
[self.playerTableView endUpdates];
當然,如果我只是發送消息:[self.playerTableView reloadData];該視圖將顯示正確。不過,我們真的需要這個程序來動畫,以提供一個光鮮的體驗。也許如果在完成插入動畫時觸發了一個委託事件,我可以從thbe數據源更新視圖以擺脫毛刺,但是我沒有發現任何像這樣的鉤子。
任何幫助將不勝感激。