aqavi_paracha
aqavi_paracha

Reputation: 1131

how to display drop-down in iphone, like in this image

hi I want to display drop down menu like the one you see in this image http://callingcard.marigoholdings.com/Screenshots.html#1 (below From and To) How can i create that? Any good tutorial. Best regards

Upvotes: 1

Views: 5283

Answers (3)

j2emanue
j2emanue

Reputation: 62519

I wonder if a UIActionsheet might be better ... you could easy make a button to call the sheet. Adding multiple buttons to the sheet transforms it into a table that you can scroll.

Upvotes: 0

kevboh
kevboh

Reputation: 5245

It looks like that app is using a combination of a UIWebView and an html select tag. To do something similar would involve a solid bit of html and javascript hackery, but in essence would be:

  1. Create a UIWebView and inject the appropriate HTML into it to make the dropdown.
  2. User uses dropdown as if it was in mobile safari and picks something.
  3. When you need it, you use a javascript call with stringByEvaluatingJavaScriptFromString: to grab the value of the dropdown by id and pass it back to your code.

There are a few gotchas here, mainly with constructing the dropdown and the webview such that it's big enough to show the expanded dropdown but transparent to see under it when the dropdown is not expanded, it's not scrollable, and that sort of thing.

Upvotes: 0

Aditya
Aditya

Reputation: 4396

You will have to use UIPicker for this purpose.This is used as a dropdown whereever needed in iPhone.

Please refer the link below

How to create drop down list box for an iphone app

Thanks

Upvotes: 1

Related Questions