Android date/time wheel picker

Amos picture Amos · Apr 6, 2015 · Viewed 13k times · Source

How can I achieve this layout for a time picker (and also for a date picker)? The default layout is either a (very big) clock or a (not beautiful) spinner style time picker. I saw this in several apps but couldn't find how to achieve this look and feel.

enter image description here

Answer

Rodrigo Borges picture Rodrigo Borges · Dec 15, 2017

For future reference for anyone that might need this, it is possible to achieve this time picker spinner by just choosing a TimePicker among the android widgets and then, on the xml file, type android:timePickerMode="spinner".

Your widget xml code should look like this:

<TimePicker
    android:id="@+id/timePicker"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:timePickerMode="spinner" />

My answer was based on the documentation.