Android picker widget for arbitrary strings

廉价感情. 提交于 2019-12-07 04:53:41

问题


I'm looking to make a basic picker in Android that looks like the built-in date and time pickers but uses a custom array of strings instead of dates and times:

http://developer.android.com/guide/topics/ui/controls/pickers.html

This is probably one of the most basic questions and I see lots of custom pickers and wheels floating around, but I would particularly want this to have the same look and feel as the built-in pickers. What is the best way to do this?

Edit: so I'm using TimePicker widget to display a time selector, but what can I use to select from a list of arbitrary strings instead?


回答1:


The look and feel comes from android.widget.NumberPicker

<NumberPicker
    android:id="@+id/numberPicker1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />


来源:https://stackoverflow.com/questions/16041905/android-picker-widget-for-arbitrary-strings

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