Ajith
Ajith

Reputation: 2666

Android Datepicker text color change not working

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.

Upvotes: 2

Views: 3227

Answers (2)

Amit Kumar
Amit Kumar

Reputation: 391

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.

Upvotes: 0

Athul
Athul

Reputation: 821

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

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

Upvotes: 1

Related Questions