Iphone 如何使用动画在uitableview中显示/隐藏剖面行?

Iphone 如何使用动画在uitableview中显示/隐藏剖面行?,iphone,uitableview,Iphone,Uitableview,我见过一些iPhone应用程序,它们在加载行的其他部分后显示行的第一部分,直到你点击它们,它们才会显示出来 如果你想看到更多的数据,你必须点击特定的部分,这样它就会折叠并显示数据行 一些不清楚的想法: - (void)beginUpdates; - (void)endUpdates; - (void)insertSections:(NSIndexSet *)sections withRowAnimation: (UITableViewRowAnimation)animation; - (voi

我见过一些iPhone应用程序,它们在加载行的其他部分后显示行的第一部分,直到你点击它们,它们才会显示出来

如果你想看到更多的数据,你必须点击特定的部分,这样它就会折叠并显示数据行

一些不清楚的想法:

- (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;

但不知道如何检测区段标题上的点击

有人知道我怎么做吗

i、 e如何在uitableview中实现可折叠部分


谢谢。

但不知道如何检测节标题上的点击

==>实现sectionheader的自定义视图(table delegate viewForHeader)并在其中放置一个按钮

i、 e如何在uitableview中实现可折叠部分? ==>在标题按钮调用的方法中使用插入/删除行方法 ==>请确保您的numberOfRows方法保持最新

如果您总是隐藏/显示所有行,这是非常直接的。如果显示/隐藏特定行,则更为棘手