折叠Objective-c中的部分

时间:2013-02-28 10:22:15

标签: ios objective-c cocoa-touch

我正在我的应用程序中创建一个应用程序表单,并且我想创建一些有创意的东西,所以我想到将各个表单组件放在一起(如下图所示),然后对它们进行折叠和扩展影响。

collapsed expanded

是否有任何类或某些东西可以帮助我实现这一点,或者我必须手动完成?

1 个答案:

答案 0 :(得分:3)

我曾经利用UITableView和方法

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

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

模拟和扩展/崩溃行为。

有关详细信息,请参阅documentation

我已经使用了可选择的节标题(通过UIButton或手势识别器)让用户展开/折叠。

还有很多教程使用不同的技术进行了解释:

最后,您可以查看应该提供您要搜索的功能的控件:

UIExpandableTableView