Android的选择器部件的任意字符串 [英] Android picker widget for arbitrary strings
问题描述
我期待在做Android的一个基本选择器看起来像内置的日期和时间选择器,但使用字符串而不是日期和时间的一个自定义的数组:
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 /控制/ 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?
编辑:所以我用 TimePicker
小工具来显示时间的选择,但我能使用从任意的字符串列表中进行选择,而不是
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?
推荐答案
的外观和感觉来自<一个href="https://github.com/android/platform_frameworks_base/blob/master/core/java/android/widget/NumberPicker.java">android.widget.NumberPicker
<NumberPicker
android:id="@+id/numberPicker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
这篇关于Android的选择器部件的任意字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!