¡@

Home 

2014/10/15 ¤U¤È 10:13:41

iphone Programming Glossary: sectionopen

How to implement an accordion view for an iPhone SDK app?

http://stackoverflow.com/questions/1944428/how-to-implement-an-accordion-view-for-an-iphone-sdk-app

than just a table. This is a quick hack that should work but in your UITableViewController subclass's .h file bool sectionopen 4 or some other way of storing the sections expanded closed state And in the .m file put something like NSInteger numberOfSectionsInTableView.. NSInteger section return 4 CGFloat tableView UITableView tableView heightForRowAtIndexPath NSIndexPath indexPath if sectionopen indexPath.row return 240 it's open else return 45 it's closed UITableViewCell tableView UITableView tableView cellForRowAtIndexPath.. return mycell void tableView UITableView tableView didSelectRowAtIndexPath NSIndexPath indexPath turn them all off sectionopen 0 NO sectionopen 1 NO sectionopen 2 NO sectionopen 3 NO open this one sectionopen indexPath.row YES animate the opening..