[英]change the text color of Time Picker [android]
How can I Change the Text color of Time picker in android ..... I am having a black shadow background in my application and by default the time in Time picker is also in black so the time is not visible....如何更改 android 中时间选择器的文本颜色.....我的应用程序中有黑色阴影背景,默认情况下时间选择器中的时间也是黑色的,因此时间不可见....
The default view of the time picker is时间选择器的默认视图是
my XMl Entry is :我的 XML 条目是:
<TimePicker
android:id="@+id/timePicker"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
android Java code is : android Java代码是:
timePicker = (TimePicker)findViewById(R.id.timePicker);
hour = calendar.get(Calendar.HOUR_OF_DAY);
minute = calendar.get(Calendar.MINUTE);
timePicker.setCurrentHour(hour);
timePicker.setCurrentMinute(minute);
You could create your own XML layout for the datepicker as in the example here .您可以为日期选择器创建自己的 XML 布局,如此处的示例所示。
Not sure how well this will play with your activity if it is extending FragmentActivity, but should give you a start in the right direction.如果它正在扩展 FragmentActivity,不确定这将如何与您的活动一起发挥作用,但应该让您朝着正确的方向开始。
转到res > values > theme.xml并在样式标签内添加一个带有属性“android:textColorPrimary”的项目并设置您想要的颜色。
<item name="android:textColorPrimary">@color/white</item>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.