簡體   English   中英

UITableView reloadSections在一行頂部創建一個sectionheader

[英]UITableView reloadSections creates a sectionheader on top of a row

我有一個帶有一個sectionheader的tableview。 使用以下代碼片段,當用戶向左或向右滑動視圖時,我將重新加載tableview。

[self.tableView beginUpdates];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0]    withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView reloadRowsAtIndexPaths:[self.tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView endUpdates];

當用戶在表格視圖中向下滑動然后滑動時,此代碼段可正確重新加載行,但會在開始滑動的行頂部創建節頭。

誰能告訴我我在做錯什么以及如何解決?

謝謝弗蘭克

我認為問題在於在iOS 4.0上reloadSections:withRowAnimation似乎有問題,並且已在更高版本之一中修復。

在iOS 4.0上,調用reloadSections:withRowAnimation導致表標題出現在一行的中間,而在4.3上它可以正常工作。 我已經用不太理想的reloadData代替了它,但它也適用於4.0。

暫無
暫無

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

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