Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create drop down list box for an iphone app

Tags:

iphone

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.

like image 601
user448349 Avatar asked Sep 15 '10 11:09

user448349


2 Answers

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.

like image 89
Dan Ray Avatar answered Sep 27 '22 22:09

Dan Ray


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.

like image 42
Lou Franco Avatar answered Sep 27 '22 22:09

Lou Franco