2010-05-24 89 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方法最新

这是很简单的,如果你总是隐藏/显示所有行。如果您显示/隐藏特定的行更棘手。