完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/NumberPicker.html
NumberPicker
public class NumberPicker
extends LinearLayout
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.LinearLayout | |||
↳ | android.widget.NumberPicker |
A widget that enables the user to select a number from a predefined range. There are two flavors of this widget and which one is presented to the user depends on the current theme.
- If the current theme is derived from
Theme
the widget presents the current value as an editable input field with an increment button above and a decrement button below. Long pressing the buttons allows for a quick change of the current value. Tapping on the input field allows to type in a desired value. - If the current theme is derived from
Theme_Holo
orTheme_Holo_Light
the widget presents the current value as an editable input field with a lesser value above and a greater value below. Tapping on the lesser or greater value selects it by animating the number axis up or down to make the chosen value current. Flinging up or down allows for multiple increments or decrements of the current value. Long pressing on the lesser and greater values also allows for a quick change of the current value. Tapping on the current value allows to type in a desired value.
一个widget,其允许用户从预定义的范围中选择一个数字。此控件有2种不同的样式,使用哪一个,取决于用户使用的当前主题。
- 如果当前主题是从
Theme
中导出的,则控件将当前的值呈现为一个可编辑的输入字段,上面有一个递增按钮,下面有一个递减按钮。长按这些按钮允许快速的改变当前值。点击输入字段,就可以输入想要的值。 - 如果当前主题是从
Theme_Holo
或Theme_Holo_Light
导出的,则控件将当前的值呈现为一个可编辑的输入字段,并且较小的值在上面,较大的值在下面。点击较小或叫大的值来选择它,其通过使数字轴向上或向下的动画来选择当前的值。向上或向下的Fling允许对当前值进行多次递增或递减。在较小或较大的值上长按也会快速的改变当前值。点击当前值,就可以输入想要的值。
For an example of using this widget, see TimePicker
.
使用此控件的例子,请参考TimePicker
。
摘要
嵌套类 | |
---|---|
interface | NumberPicker.Formatter Interface used to format current value into a string for presentation. |
interface | NumberPicker.OnScrollListener Interface to listen for the picker scroll state. |
interface | NumberPicker.OnValueChangeListener Interface to listen for changes of the current value. |
继承XML属性 | |
---|---|
From class android.widget.LinearLayout
| |
From class android.view.ViewGroup
| |
From class android.view.View
|
继承常量 |
---|
From class android.widget.LinearLayout
|
From class android.view.ViewGroup
|
From class android.view.View
|
继承字段 |
---|
From class android.view.View
|
Public构造方法 | |
---|---|
NumberPicker(Context context) Create a new number picker. | |
NumberPicker(Context context, AttributeSet attrs) Create a new number picker. | |
NumberPicker(Context context, AttributeSet attrs, int defStyleAttr) Create a new number picker | |
NumberPicker(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) Create a new number picker |
Public方法
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/NumberPicker.html