Is there a component like DatePicker for selecting String values?
I want the user to be able to select from a list of string values (about 25 in all) and like the idea of using the DatePicker style component to do it. However, all I can find is the spinner which is a drop down box and my selection list is just a little too big for it. Is there a component like Date开发者_如何学JAVAPicker I can use?
there is no such component in Android. I have an idea.
lets go with an AlertDialog
with the combination of ListView
at the view level. To do that create an AlertDialog and then create a view having listview that contains 25 string elements in connected by a SimpleAdapter
. Once you done with the listview and adapter stuff, come to the Alertdialog
and use setView()
of AlertDialog.Builder
.
The Documentation: Adding a List to AlertDialog.
精彩评论