2010-05-24 92 views
1

我已經看到一些iPhone應用程序,它們顯示加載後的第一部分行其他部分的行將不可見,直到你點擊它們。如何使用動畫在uitableview中顯示/隱藏部分行?

如果你想看到更多的數據,你必須點擊那個特定的部分,這樣它會崩潰並顯示數據行。

一些不清楚的想法:

- (void)beginUpdates; 
- (void)endUpdates; 

- (void)insertSections:(NSIndexSet *)sections withRowAnimation: (UITableViewRowAnimation)animation; 
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation: (UITableViewRowAnimation)animation; 

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation; 
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation; 

但不知道如何檢測上節頭自來水?

任何人都知道我該怎麼做?

即如何在uitableview中實現可摺疊的部分?

謝謝。

回答

2

但不知道如何檢測節標題上的點按?

==>爲sectionheader(table delegate viewForHeader)實現一個自定義視圖,並在其中放置一個按鈕。

即如何在uitableview中實現可摺疊的部分? ==>使用插入/刪除行的方法在你的方法,通過標題按鈕叫 ==>一定要保持你的numberOfRows方法最新

這是很簡單的,如果你總是隱藏/顯示所有行。如果您顯示/隱藏特定的行更棘手。