物料日期选择器文本颜色 [英] Material Date Picker text color

查看:83
本文介绍了物料日期选择器文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更改DatePicker的文本颜色

I am trying to change the text color of my DatePicker

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

此代码仅提供3个选择器,分别是月,日和年.如何更改文本颜色?

This code just gives 3 pickers, month, day and year. How can I change this text color?

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

其中Widget.Material.Light.DatePicker是Widget下的所有DatePicker选项

where Widget.Material.Light.DatePicker has been all the DatePicker options under Widget

推荐答案

与大多数组件一样,DatePicker的文本颜色受textColorPrimary的影响:

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

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

这篇关于物料日期选择器文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆