I have tried using custom style but it is not working , its default color is greyish and I want it to be white colored, can anyone help me out? TIA
XML
<DatePicker
android:id="@+id/user_dob"
android:hapticFeedbackEnabled="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:calendarViewShown="false"
style="@style/MyDatePickerStyle"
android:datePickerMode="spinner"/>
styles
<style name="MyDatePickerStyle" parent="@android:style/Widget.Material.Light.DatePicker" tools:targetApi="lollipop">
<item name="android:headerBackground">@color/white</item>
<item name="android:calendarTextColor">@color/white</item>
<item name="android:dayOfWeekBackground">@color/white</item>
<item name="android:yearListSelectorColor">@color/white</item>
<item name="android:datePickerMode">calendar</item>
<item name="android:minDate">01/01/1970</item>
</style>
You can use:
<DatePicker
android:theme="@style/MyDatePicker"
..>
with:
<style name="MyDatePicker" >
<!-- Text color -->
<item name="android:textColorPrimary">@color/....</item>
<!-- Divider color -->
<item name="colorControlNormal">@color/...</item>
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With