Simple Accordion Menu in ios

风格不统一 提交于 2019-12-10 08:12:40

问题


I want to develop a simple accordion menu in ios but I could not find an example of the way I want. Accordion menu headers to include an image(arrow) and text. Clicking on this text its content will be visible. If clicked again it must be closed.

For example:

>> Title1
>> Title2
>> Title3

If click Title1 it expands.

<< Title1
  Including text information...
>> Title2
>> Title3

How to make the easiest way? Thank you for your advice.


回答1:


What you're after is a UITableView, with functions on the row selection delegate methods to manipulate the underlying data and add rows and re-render with the cell animation that slides the cells in from the top.

Here's a tutorial from Cocoanetics.




回答2:


I believe you are looking for a popover view, though those are only available on iPad. Otherwise some variation of a modal view for iPhone might suit your needs.

http://www.raywenderlich.com/1056/ipad-for-iphone-developers-101-uipopovercontroller-tutorial http://developer.apple.com/library/IOS/#documentation/UIKit/Reference/UIPopoverController_class/Reference/Reference.html



来源:https://stackoverflow.com/questions/7403467/simple-accordion-menu-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!