1

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

aqavi_paracha
  • 1,131
  • 2
  • 17
  • 38

3 Answers3

1

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

Community
  • 1
  • 1
Aditya
  • 4,414
  • 5
  • 29
  • 40
  • 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
  • Thats the easiest and fastest way to do. – Aditya Dec 10 '10 at 04:58
0

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.

j2emanue
  • 60,549
  • 65
  • 286
  • 456
0

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.

kevboh
  • 5,207
  • 5
  • 38
  • 54