iPhone scroll-wheel picker for <select> menus

血红的双手。 提交于 2019-12-12 02:45:24

问题


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

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>

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:

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):

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??


回答1:


Check this out:

https://github.com/arkichek/AFPickerView




回答2:


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

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



来源:https://stackoverflow.com/questions/12060498/iphone-scroll-wheel-picker-for-select-menus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!