-2

Update:

Please read my question very carefully. I am trying to change the background colours of both title and header in the dialog. I am not trying to change any text color or only header background color.

Question: I am using the material DatePickerDialog in my project. I am trying to change the title color which is in little dark color compared to the header background color. I want the header background and title background to be same.

Here is the screenshot:

enter image description here

I want to change the "Friday" title background color to the same normal green color of the header background. How can I achieve it ?

sagar suri
  • 4,351
  • 12
  • 59
  • 122

2 Answers2

0

open colors.xml file and chane color as you want in these

<color name="colorPrimary">Your color</color>
 <color name="colorPrimaryDark">Your color</color>
 <color name="colorAccent">Your color</color>
Harsh Singhal
  • 567
  • 4
  • 12
  • Nope it didn't workout. still I can see the dark pink color behind "Friday" title. I want the header background and title background to be same. – sagar suri Dec 26 '17 at 09:43
0

Add style like this and set to your DatePicker,

<style name="CustomDtPicker" parent="android:Widget.Material.Light.DatePicker">
    <item name="android:colorPrimary">@color/Green</item>
</style>

Note : You require minimum API level 21 to use this parent as you want Material DatePicker.

Dhruv Patel
  • 1,529
  • 1
  • 18
  • 27