Android Searchable Dropdown spinner?

主宰稳场 提交于 2019-12-12 03:15:17

问题


I have some data (list of countries) with 249 entries. I want to force the user to choose one of these options.

Usually I would use a spinner, however I feel like 249 entries would be too many to scroll through, particularly for people with smaller phones.

Is there anyway in android to have either:
a) a dropdown spinner that is searchable (so the panel where the chosen selection is usually displayed can be used to enter a search term)
b) an AutoCompleteTextView that forces the user to select one of the options from the AutoComplete suggestions.

Thanks.


回答1:


Beginning in Android 3.0, using the SearchView widget as an item in the action bar is the preferred way to provide search in your app.

http://developer.android.com/training/search/setup.html



来源:https://stackoverflow.com/questions/28945310/android-searchable-dropdown-spinner

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