I need to add dropdown list box for an iphone app. I couldn’t find this object in the library. Instead there is picker view, but i need compact object like dropdown list box. Please suggest me how to add or create this.
Thanks in advance.
No such thing exists. You can either create your own control, or use UIPicker. Creating your own drop-down control is quite a bunch of work, compared to using the Picker, and unless that particular control is mission-critical, I'd recommend you figure out how to use UIPicker inside your existing design. Not only does it already exist, but users are familiar with it and know how to use it. There really is a point to Human Interface Guidelines and a standard set of UI elements.
In situations where I've needed a picker-like control in a small amount of space, I've used a label and a button that brings up another view containing the picker. You can slide that in using UINavigationController, or just present the view modally. That's how I mostly see apps handling this.
EDIT: Or use UIActionSheet like @Lou Franco says. That's a pretty good option too.
Usually, you see either a UIActionSheet, like this
Creating iPhone Pop-up Menu Similar to Mail App Menu
Or a another view slide in with the choices. It depends on whether you have a small finite number or a long or unbounded list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With