Harshil Pansare
Harshil Pansare

Reputation: 1147

How to customize date/time picker in android?

I can create such dialog using AlertDialog library, however I want to use same kind of input for height and weight. Creating a custom dialog will need implementing many things such as 'sliding to change the value'. How should I edit the values in existing picker?

Date Picker

Upvotes: 1

Views: 1897

Answers (1)

LordRaydenMK
LordRaydenMK

Reputation: 13321

The DatePickerDialog dialog contains three NumberPicker widgets under the hood.

All you have to do is create an AlertDialog with custom view containing a single NumberPicker widget. The display and sliding is provided by the NumberPicker widget. You can set min value, max value, default value etc...

Upvotes: 2

Related Questions