Has anyone seen an implementation of an \"accordion\" (maybe called \"animated outline\") view for the iPhone? I found an example project for Cocoa, but before trying a port
Every solution that I found was using UITableView, which didn't work for me, because I didn't display tabular data. This is why I created AccordionView control. Usage is pretty straightforward:
AccordionView *accordion = [[AccordionView alloc] initWithFrame:CGRectMake(0, 0, 320, 420)];
[self addSubview:accordion];
// Only height is taken into account, so other parameters are just dummy
UIButton *header1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 0, 30)];
[header1.titleLabel setText:@"First row"];
UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 200)];
// ... add subviews to view1
[accordion addHeader:header1 withView:view1];
// ... add more panels
[accordion setSelectedIndex:0];
In real life it looks like this:

Black bars are headers and you can customize them all you want (I'm using Three20).