简体   繁体   中英

List selector like AB Contact edit phone/email type

I am trying to create a very similar to Contact Edit functionality with similar abilities to select and create a new label for an item. One option is to use UIActionSheet, but this would not allow for ability to add a new item, and no check either. Similarly Picker... Second, and I think this is how it is done by Apple is the button that triggers a row selector? Or perhaps just creates a pop up view? That comes up from the bottom.

Does anyone know how it is actually done? Can any one suggest an example for me to look at to implement this? thanks

So the basic idea is you have a button in the tableview (maybe in the footer or in a row) and when they press the button you can use UITableView 's insertRowsAtIndexPaths:withRowAnimation: to add a new row which can have your new field/label etc. If you search for samples on developer.apple.com you'll find some samples using that method. Search for insertRowsAtIndexPaths: and you'll pull up several examples. Download and run them and when you see one that has what you want go look at the source.

What I did find was github.com/simonb/SBTableAlert, which does not work exactly as list selector in the contacts, but is a very nice option for a pop up selected of many different kinds. It may not be as pretty but a much simpler solution that is very nice IMHO.

So this is, as I figured out is a basic segue "Modal" transition "cover Vertical" to a another navigation controller and a table within it. After button click within a Row. Nothing complicated as one gets some experience ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM