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
-
1Which image do you mean? – Claus Broch Dec 09 '10 at 14:08
-
@Claus Fixed that. He probably cannot yet insert images. – Anton Gogolev Dec 09 '10 at 14:11
-
@Anton yeah, You are right, As a new user at stackoverflow, i got the message of not being able to upload images yet. Lemme google for similar image, and share the link – aqavi_paracha Dec 09 '10 at 14:14
3 Answers
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
-
yeah, i know that.. But UIPicker covers almost half of the screen. I wanna show it as a one row. And when it is tapped, it should display UIPicker Thanks – aqavi_paracha Dec 09 '10 at 14:29
-
So basically you want a picker which shows 1 row and after tapping on that row or the arrow button besides it,the picker has to be displayed.Ri8?? – Aditya Dec 09 '10 at 14:40
-
Use a button to display a single line and onclick of that button pop the UIPicker and populate that button again when a value is selected from the picker. – Aditya Dec 09 '10 at 15:17
-
thank u so much Aditya... Now i try to do that... and will respond you when i am done – aqavi_paracha Dec 09 '10 at 19:34
-
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.

- 60,549
- 65
- 286
- 456
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:
- Create a UIWebView and inject the appropriate HTML into it to make the dropdown.
- User uses dropdown as if it was in mobile safari and picks something.
- 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.

- 5,207
- 5
- 38
- 54