Questions tagged [numberpicker]

A Number Picker is a UI element that lets the user pick a numeric value.

NumberPickers define the input value to be numbers and optionally some other numeric characters, like . or -.

This definition is useful for input sanitation, and it allows mobile devices to show a numeric-only keyboard when the input field is edited.

Examples:

353 questions
79
votes
5 answers

How to create a number picker dialog?

I want to be able to create a Dialog that allows the user to pick a number from a specified range. I know that there are existing widgets(like those from quietlycoding and the one by SimonVT) that already does this but I'm having hard time…
Razgriz
  • 6,640
  • 12
  • 63
  • 138
59
votes
3 answers

Android NumberPicker: Set min, max, default from XML

Is there a way to set the minimum, maximum and default values of a NumberPicker from the XML Layout? I'm doing it from within the Activity code: np = (NumberPicker) findViewById(R.id.np); np.setMaxValue(120); np.setMinValue(0); np.setValue(30); XML…
Adam Matan
  • 107,447
  • 124
  • 346
  • 512
55
votes
10 answers

Change the text color of NumberPicker

I've looked at most all of the threads on this and none provided an answer that works. Styling the NumberPicker does not work (as per this thread: NumberPicker textColour) Setting the style attribute on the numberPicker to a style that has a color…
Odaym
  • 1,777
  • 1
  • 18
  • 31
53
votes
3 answers

NPE in ChangeCurrentByOneFromLongPressCommand (on Samsung devices w/ Android 4.3)

Using a couple android.widget.NumberPicker in my Android App view and I get the following message when I hold down on one of the numbers arrows:- FATAL EXCEPTION: main java.lang.NullPointerException at…
user3145914
  • 547
  • 3
  • 4
39
votes
11 answers

Changing NumberPicker divider color

On recent android versions, number pickers use a blue divider when drawn (cf. image below). I would like to change this color. Is there a working solution? or perhaps a library that package an updated version of NumberPicker that allows customizing…
Laurent
  • 12,925
  • 13
  • 47
  • 75
36
votes
10 answers

Android NumberPicker with Formatter doesn't format on first rendering

I have a NumberPicker that has a formatter that formats the displayed numbers either when the NumberPicker spins or when a value is entered manually. This works fine, but when the NumberPicker is first shown and I initialize it with setValue(0) the…
A. Steenbergen
  • 3,180
  • 3
  • 31
  • 48
32
votes
2 answers

How to make NumberPicker non-recurring

Is there any attribute to tell a (standard) NumberPicker to stop after its last value? E.g. if my MinValue was 0 and my MaxValue was 5 the NumberPicker just repeats itself after the 5, so that the user could scroll endlessly.
Simon Flückiger
  • 455
  • 1
  • 5
  • 9
25
votes
4 answers

Android PreferenceActivity dialog with number picker

I have seen many customized solutions and answers to this question. I need something very simple, I have a preference activity and all I need is that one of the options will open dialog with a number picker and save the results. Can you please guide…
Dim
  • 3,529
  • 10
  • 67
  • 119
21
votes
4 answers

how to use number picker with dialog

I want to use a number picker for the purpose of getting the discount percentage from the user. once the user enters the sale price, i want a dialog box to appear asking for the discount percentage. I cannot find a way to integrate the numberpicker…
kayveesin
  • 411
  • 1
  • 4
  • 16
19
votes
2 answers

NumberPicker widget in Flutter?

Is there anything like NumberPicker widget in flutter? I mean something similar to DatePicker but just for choosing numbers. If the answer is no, do you have any suggestions on how I could implement such a thing? Thanks in advance :) EDIT: Solved by…
Marcin Szałek
  • 3,144
  • 3
  • 22
  • 36
15
votes
1 answer

How to increase font size NumberPicker Android 6.0?

I have noticed that the NumberPicker in Android 6.0 has a very very small font size compared to previous versions. The font size is so small I can only assume it's a bug... I can't find a way to increase the font size of the NumberPicker. There is…
Greg Ellis
  • 1,797
  • 3
  • 18
  • 26
15
votes
3 answers

How do you display a 2 digit NumberPicker in android?

I want to create a timer and since I couldn't create a digital interface that is editable for the user to set the time I want to use the NumberPicker. However the NumberPicker only displays 1 digit for the numbers between 0-9. How do you format…
illis69
  • 165
  • 1
  • 9
14
votes
6 answers

Setting typeFace to NumberPicker

How change font type in NumberPicker. I try to do like this, but font not changing. Any idea? P.S: color and textSize are change. public class NumberPicker extends android.widget.NumberPicker { private Context context; private…
once2go
  • 1,333
  • 1
  • 10
  • 21
13
votes
3 answers

Android: NumberPicker doesn´t work

I added a NumberPicker to my layout and debugged my app. Now I see that the NumberPicker doesn´t work, I can´t see any "+" or "-" button and also when I click on a number on my keyboard, nothing happens. Here´s my layout file:
user896692
  • 2,251
  • 7
  • 34
  • 56
12
votes
4 answers

Android: How to remove divider lines in number picker

How can I remove divider lines in number picker, I tried setShowDivider to none(seems none doesn't exist) through xml and code noting worked picker.setShowDividers(LinearLayout.SHOW_DIVIDER_NONE); XML: android:showDividers="none"
blackHawk
  • 4,966
  • 8
  • 47
  • 94
1
2 3
23 24