Simple Accordion Menu in ios

2019-05-15 06:51发布

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.

2条回答
Emotional °昔
2楼-- · 2019-05-15 07:25

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.

查看更多
何必那么认真
3楼-- · 2019-05-15 07:35

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

查看更多
登录 后发表回答