用于< select>的iPhone滚轮选择器菜单 [英] iPhone scroll-wheel picker for <select> menus

查看:163
本文介绍了用于< select>的iPhone滚轮选择器菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发UIWebView iPhone应用程序和移动网站,并且在该应用程序中,我有许多<select>菜单,每个菜单包含100多个项目!

I'm developing a UIWebView iPhone app and mobile website and within the app I have many <select> menus that contain 100+ items each!

我想知道是否有一种方法可以将<select>菜单分成子菜单,以使iPhone用户更容易进行选择,例如:

I was wondering if there is a way to break the <select> menu into submenus in order to make it easier for iPhone users to make selections, ex:

我的数据库设置是这样的:

I have this for my database setup:

                   |   Subcategory     |      Food      |
                   --------------------------------------
                   |eggs and cheese    |scrambled       |
                   |breakfast cereal   |frosted flakes  |
                   |breakfast cereal   |mini wheats     |
                   |breakfast cereal   |cherrios        |

因此,每个商品都有一个子类别",然后是一个实际的食物"

So each item has a "sub-category" and then the actual "food"

我将其打印到这样的下拉列表中:

I print that into dropdowns like this:

<select class="breakfast">
  <option value="100" rel="20">Breakfast Cereal (Frosted Flakes)</option>
  <option value="200" rel="10">Breakfast Cereal (Cheerios)</option>
  <option value="150" rel="25">Breakfast Cereal (Mini Wheats)</option>
  <option value="300" rel="30">2 Eggs and Cheese (scrambled)</option>
</select>

当我触摸iPhone上的下拉菜单进行选择时,所有4个选项都列在iPhone默认设置为的滚轮UI中:

And when I touch the dropdown on the iPhone to make a selection, all 4 options are listed in that scroll wheel UI that iPhone defaults to:

我想以某种方式进行设置,这样我可以有2个滚轮,左侧的子类别,然后选择它,它就为您提供右侧的食物"选项,像这样(但只有2个轮子):

I would somehow like to set it up so that I can have 2 scroll wheels with the Subcategories on the left and then once you pick that, it gives you the options for "food" on the right, like this (but with only 2 wheels):

此示例是左侧的滚轮,带有2个选项Eggs and CheeseBreakfast Cereals,然后当用户触摸Breakfast Cereals时,会将3个谷物选项加载到右侧的滚轮选择器UI中!

This example would be a scroll wheel on the left with 2 options, Eggs and Cheese and Breakfast Cereals, then when the user touches Breakfast Cereals, it would load the 3 cereal options into the scroll wheel picker UI on the right!

这有点复杂,但是有没有人对此有经验,或者有可能吗?

This is a little complicated, but does anyone have experience with this, or is it even possible??

推荐答案

我在这里解决了我的问题:

I solved my problem here: Add a search function to UIPickerView in Xcode, or open <select> menu in UITableView

我使用jQuery通过网站在应用程序外部过滤结果.

I filter the results outside of the app, through the website using jQuery.

这篇关于用于&lt; select&gt;的iPhone滚轮选择器菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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