开发者

Is there a component like DatePicker for selecting String values?

开发者 https://www.devze.com 2023-02-11 08:50 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消