我怎样才能改变我的timepicker和日期选择器的文本颜色?

问题描述:

目前我的工作我的第一个应用程序之一。在这个应用程序,我有一个 TimePicker 的DatePicker 。我现在的活动有一个黑暗的背景。现在,我想要一个白色的文本颜色在我的 TimePicker / 的DatePicker

Currently I am working on one of my first applications. In this application I have a TimePicker and a DatePicker. My current Activity has a dark background. Now I want a white textcolor in my TimePicker/DatePicker.

在我的布局,我已经定义了我的采摘:

In my layout I have defined my pickers:

<DatePicker android:id="@+id/dpDateOfValue" android:calendarViewShown="false" />
<TimePicker android:id="@+id/tpTimeOfValue" />

该解决方案应该在2.3 - 4.1

The solution should work on 2.3 - 4.1

使用:

<style name="MyHolo" parent="android:Theme.Holo.NoActionBar">

        ...

        <item name="android:editTextColor">#000000</item>
</style>

要设置TimePicker文本颜色的API> = 11

to set TimePicker text color for API >= 11