我一直在尝试更改我的timepicker的textcolor。但是我找不到父母的位置。我都试过更改TimePicker文本颜色
<style name="MyTimePicker" parent="@android:style/Widget.Holo.TimePicker">
<item name="android:textColor">@color/text</item>
</style>
和
<style name="MyTimePicker" parent="@android:style/Widget.TimePicker">
<item name="android:textColor">@color/text</item>
</style>
我minSdkVersion
是15.我targetSdkVersion
是20.我已经rebuilded和清理我的项目。
我想我已经通过了所有关于SO的类似问题,并没有一个真的为我提供了解决方案。可能工作的唯一答案是使用某种图书馆,但我不是那种解决方案的忠实粉丝。父母的路径与我使用的路径有什么不同,因为我很确定我应该能够以某种方式访问它?
编辑
这就是主题如何应用;
在一张纸条,这是我收到的错误(忘记之前把它):
Error:Error retrieving parent for item: No resource found that matches the given name '@android:style/Widget.Holo.TimePicker'.
编辑2 一对夫妇的我认为,试图解决这个问题:
- How can I override TimePicker to change text color - 我觉得这个问题接近答案,但我不完全确定我需要做什么?我是否需要将Android TimePicker样式导入到我的项目中?
- https://stackoverflow.com/questions/24973586/set-textcolor-for-timepicker-in-customized-app-theme - 未给出答案。
- How can i change the textcolor of my timepicker and datepicker? - 尝试了0票的答案,但它没有奏效。
- How to change the default color of DatePicker and TimePicker dialog in Android? - 再次无法以类似的方式找到TimePicker。
- Android - How do I change the textColor in a TimePicker? - 再次,找不到实际的TimePicker父级。
这些可能是我的问题的最佳问题/答案,但他们都没有帮助我。这将是很好的,得到一个明确的答案。
第一种风格应该工作,你是如何应用这种风格的? – pskink 2014-09-24 11:51:50
@pskink更新了答案 – Bono 2014-09-24 11:56:10
试过[this](http://stackoverflow.com/a/21361885/3249477)? – Simas 2014-09-27 13:41:36