5

How can I Change the Text color of Time picker in android ..... I am having a black shadow background in my application and by default the time in Time picker is also in black so the time is not visible.... enter image description here

The default view of the time picker is

enter image description here

my XMl Entry is :

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

android Java code is :

timePicker  = (TimePicker)findViewById(R.id.timePicker);
hour = calendar.get(Calendar.HOUR_OF_DAY);
        minute = calendar.get(Calendar.MINUTE);

    timePicker.setCurrentHour(hour);

    timePicker.setCurrentMinute(minute);
Sumit Patel
  • 2,547
  • 8
  • 33
  • 45

2 Answers2

0

You could create your own XML layout for the datepicker as in the example here.

Not sure how well this will play with your activity if it is extending FragmentActivity, but should give you a start in the right direction.

MattMakes
  • 569
  • 1
  • 5
  • 17
0

Go to res > values > themes.xml and add an item inside style tag with attribute "android:textColorPrimary" and set the color you want.

<item name="android:textColorPrimary">@color/white</item>