Number Picker as present in Dialog (Android)

佐手、 提交于 2019-12-12 15:16:44

问题


I am trying to implement NumberPicker in my application. I want the view to be as show in Dialogs Guide,which is

what i get when i implement the number picker

Also, i do not want to have text selected when i tap on selected item, from scroller

P.S. I tried searching around google and SO, but could not find correct answer for my question

  1. I implemented solution provided here at SO.
  2. Have already defined listener for value changed.
  3. Tutorial/Guide is here, it just a quick overview of NumberPicker widget.

I want to implement view similar to


回答1:


I think that depends on theme used

See NumberPicker at developer.android.com

Class Overview topic:

A widget that enables the user to select a number form 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.



来源:https://stackoverflow.com/questions/17640917/number-picker-as-present-in-dialog-android

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