简体   繁体   中英

how to create a dropdown list in iphone?

i did a view based application and it tat thr 3 buttons and when i click each different subviews are displayed for performing different actions.when i click 1st button it should show a textfield to enter the items---for this i should have a drop down list to list the items available so that user can select the items from there.if i use pickerview then how i should display it as it may occupy more screen space.and if there is any other method pls give me the code.

could anyone help me with clear codes to complete this task pls.

thanku

A drop-down list doesn't really fit in with the iOS interface. I would recommend a UIPickerView that is presented from the bottom of the screen, like the keyboard.

Just a suggestion

Picker is a good component better than a dropdownlist. So when the textfield is touched show the picker along with a toolbar having buttons as cancel and done. That is the user can select an option from the picker and select done to show the selected item in the textfield and cancel to cancel the picker.

Since you specified space constraint. Normally hide the picker. When user touches the textfield show the picker and again if the user selects cancel or done button hide the picker. Check your conditions in the cancel and done button actions.

I would suggest learning the Alarm.app when you set the recurrences of an alarm. A check in front of a table view cell is usually the best way to implement a similar dropdownlist in web terms.

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