2

In my project I have used Datepicker widget in the layout as follows, As I need only spinner and I have disabled calendar view for my Datepicker for lollipop version

<DatePicker
android:id="@+id/datePickr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@android:style/Widget.DatePicker"
android:calendarViewShown="false"
android:datePickerMode="spinner"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />

The problem I faced is that it shows different color for datepicker text in lollipop version. I could not able to change the color of the same.

What I need is to change the color of the datepicker text such that It shows same color in different version.

Ajith
  • 2,476
  • 2
  • 17
  • 38
  • IMHO, you will have to create your style with required text colour set and apply it instead of android style. Because the android style may change based on the android OS version. Refer [DatePicker Style](http://www.materialdoc.com/date-picker/) – Ritesh Gune Dec 16 '16 at 09:06
  • Possible duplicate of [Change Datepicker dialog color for Android 5.0](http://stackoverflow.com/questions/28738089/change-datepicker-dialog-color-for-android-5-0) – Harshad Pansuriya Dec 16 '16 at 09:11
  • I am not using a Datepicker Dialog Just Datepicker in my layout In datepicker I use And in styles.xml I use In sturio "dgts__purple" is shown but still white color on my android – Ajith Dec 16 '16 at 09:30

2 Answers2

1

As with most components, the DatePicker's text color is effected by textColorPrimary:

<item name="android:textColorPrimary">@color/Black</item>
Athul
  • 801
  • 7
  • 16
0

Are you trying to change the text color for datetext? you can achieve this with in your datepicker block

dateTextAppearance

You can provide a colorList or a single color for your datepicker.

Amit Kumar
  • 391
  • 3
  • 10