Android7.0中文API -- NumberPicker

完整内容,请查看: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 or Theme_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_HoloTheme_Holo_Light导出的,则控件将当前的值呈现为一个可编辑的输入字段,并且较小的值在上面,较大的值在下面。点击较小或叫大的值来选择它,其通过使数字轴向上或向下的动画来选择当前的值。向上或向下的Fling允许对当前值进行多次递增或递减。在较小或较大的值上长按也会快速的改变当前值。点击当前值,就可以输入想要的值。

For an example of using this widget, see TimePicker.
使用此控件的例子,请参考TimePicker

摘要


嵌套类

interfaceNumberPicker.Formatter

Interface used to format current value into a string for presentation. 
接口,其用于格式化当前值成一个字符串。 

interfaceNumberPicker.OnScrollListener

Interface to listen for the picker scroll state. 
接口,其用于监听选取滚动的状态。 

interfaceNumberPicker.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。

NumberPicker(Context context, AttributeSet attrs)

Create a new number picker.
创建一个新的NumberPicker。

NumberPicker(Context context, AttributeSet attrs, int defStyleAttr)

Create a new number picker
创建一个新的NumberPicker

NumberPicker(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Create a new number picker
创建一个新的NumberPicker

Public方法


完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/NumberPicker.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值