问题
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