views:

192

answers:

1

I would like to use a custom skin for my Datepickers and Timepickers. Changing the background in XML doesn't do the trick (it changes the background to the set, not each of its buttons). The API is painfully short and has nothing about appearance ( http://developer.android.com/reference/android/widget/DatePicker.html ). Is it possible to use a custom skin for the buttons of Datepickers and Timepickers?

A: 

Unfortunately numberpicker is an internal widget. Need to override these backgrounds. And there is no official way to do it.

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/layout/number_picker.xml

<NumberPickerButton android:id="@+id/increment"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/timepicker_up_btn" />

<EditText android:id="@+id/timepicker_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:singleLine="true"
    style="?android:attr/textAppearanceLargeInverse"
    android:textColor="@android:color/primary_text_light"
    android:textSize="30sp"
    android:background="@drawable/timepicker_input" />

<NumberPickerButton android:id="@+id/decrement"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/timepicker_down_btn" />

biorbnA