How to change text color in datepicker header Android

Hi, I'm trying to change the color of the datepicker header text, but I can't find a property to change this property. I want to change the title color to white (I know what to do) and change the title text color to black

Solution:

<style name="MyDatePickerStyle" parent="@android:style/Widget.Material.DatePicker">
    <item name="android:headerBackground">#ffffff</item>
    <item name="android:textColorPrimary">#000000</item>
</style>

resolvent:

Xml

        <DatePicker
        android:id="@+id/start_date_text"
        android:layout_width="400dp"
        android:layout_height="190dp"
        android:datePickerMode="spinner"
        android:calendarViewShown="false"
        style="@style/MyDatePicker" />

And style

<style name="MyDatePicker" parent="android:Widget.Material.Light.DatePicker">
     <item name="android:textColorPrimary">@color/Black</item>
</style>

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>