开发者

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

开发者_如何学Gohi 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


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜