iPhone / Android induce native Dropdown picker

admin

Administrator
Staff member
Is there any way to (possibly with phoneGap) induce the native mobile dropdown picker for a set of elements?

For example, someone clicks into a list:

Code:
<ul class="dropdown">
    <li>Bananas</li>
    <li>Oranges</li>
    <li>Apples</li>
    <li>Pears</li>
</ul>

And the set of elements pops up in a native iOS dropdown picker and you can click on one of them? A dropdown I'm talking about can be seen here:

<img src="https://note19.files.wordpress.com/2009/05/statepicker.jpg" alt="iPhone Select Dropdown">

I realize that you'd have to then call some other native function to get the return value of what was actually selected and "do something" with that information.

The reason I ask is because I have a custom select picker which is created using
Code:
&lt;ul&gt;
and
Code:
&lt;li&gt;
elements, so the select/dropdown box is fully customizable, and I'm happy with the way it works, but on mobile versions the long dropdown is not as user friendly as the native picker.