Customize DatePicker. Android

Is there a way to customize DatePicker? This is my layout code.

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="vertical"> <DatePicker android:id="@+id/ad_date_picker" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_margin="5dp"/> <TimePicker android:id="@+id/ad_time_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp"/> </LinearLayout> </ScrollView> 

In this case, the DatePicker date format is MM-DD-YYYY, and I would like to have it in DD-MM-YYYY, and if it is also possible, I would like to have a short month name instead of a number.

I tried to find how to do this, but to no avail.

Thanks,

Moore

+4
android layout datepicker
source share
1 answer

You cannot configure the default value.

From the User Interface page:

Android provides a set of fully implemented widgets, such as buttons, check boxes, and text input fields, so you can quickly create your own user interface. Some widgets provided by Android are more complex, such as a date picker, clock, and zoom. But you are not limited to widgets provided by the Android platform. If you want to do something more personal and create your own elements that you can execute, you can define your own View object or expand and combine existing widgets.

Read more in Creating custom components .

+2
source share

All Articles