iPhone / Android诱使本机下拉选择器 [英] iPhone / Android induce native Dropdown picker

查看:178
本文介绍了iPhone / Android诱使本机下拉选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法(可能与phoneGap)诱导原生移动下拉选择器为一组元素?

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

例如,有人点击列表: / p>

For example, someone clicks into a list:

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

这组元素会在原生iOS下拉选择器中弹出,您可以点击其中一个?我在这里可以看到一个下拉菜单:

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:

我意识到你必须调用一些其他本地函数来获取实际选择的返回值, do somethingwith the information。

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.

我问的原因是因为我有一个自定义选择选择器,它使用< ul> / code>和< li> 元素,所以选择/下拉框完全可自定义,我很高兴它的工作原理,

The reason I ask is because I have a custom select picker which is created using <ul> and <li> 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.

推荐答案

您可以使用一些javascript插件,如mobiscroll。请在此处进行演示和下载。

You could use some javascript plugins like mobiscroll. Look here for a demo and download.

希望它帮助了

这篇关于iPhone / Android诱使本机下拉选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆