Gayan
Gayan

Reputation: 1553

Drop down list for iPhone application

How can I add drop-down list to my iPhone application via Interface builder in Xcode 4. I can't see any object like drop-down list controller or something like that?

Upvotes: 0

Views: 11148

Answers (5)

j2emanue
j2emanue

Reputation: 62519

here is another way of doing it http://www.edumobile.org/iphone/iphone-programming-tutorials/a-simple-drop-down-list-for-iphone/

Or here is one not everyone knows: The action sheet is basically a drop down list if you think about it. And if you keep adding buttons to a UIActionSheet it ends up turning into a table. So just have your button call a UIActionSheet.

https://i.sstatic.net/hN8BM.png

Upvotes: 0

RK-
RK-

Reputation: 12201

Gayan, I think your question is already answered. please check this How to create dropdown box?

And as TOm H and petert mentioned , I too believe that you need to use UIPickerView.

Upvotes: 0

Tendulkar
Tendulkar

Reputation: 5540

create a button (like dropdown button) and when you click on that button call another viewcontroller which you want to display and add it as subview to the controller.

Upvotes: 0

petert
petert

Reputation: 6692

You can use UIPickerView, but it sounds like your more likely after UIActionSheet which will show a number of buttons to choose from. If these don't meet your needs you can always roll your own custom views, but this is more work. Apple's provided UI components are a good start.

Note: there's no Interface builder way to create a UIActionSheet, you have to do it in code, but it's pretty straight foward (see RootViewController class files in this Apple sample code project).

Upvotes: 1

Tom H
Tom H

Reputation: 1316

I belive the control you might want is the UIPicker (Here's an image, its at the bottom). This is the control that pops up when you select a dropdown list in safari on iOS. You can select it in the object picker in the interface editing area. There is no dropdown list controller as such, as far as I know.

Upvotes: 2

Related Questions