I've been trying to change the textcolor of my timepicker. But I can't find where the parent style is located. I've tried both
<style name="MyTimePicker" parent="@android:style/Widget.Holo.TimePicker">
<item name="android:textColor">@color/text</item>
</style>
and
<style name="MyTimePicker" parent="@android:style/Widget.TimePicker">
<item name="android:textColor">@color/text</item>
</style>
My minSdkVersion
is 15. My targetSdkVersion
is 20. I have rebuilded and cleaned my project.
I think I've been through every similar question on SO and none of them really have provided a solution for me. The only answer that might work is using some sort of library, but I'm not a big fan of that solution. Is the path to the parent something different from what I'm using, because I'm pretty sure I should be able to access it somehow?
Edit
This is how the theme is applied;
<TimePicker
style="@style/MyTimePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/timePicker"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true" />
On a note this is the error I receive (forgot to place it before):
Error:Error retrieving parent for item: No resource found that matches the given name '@android:style/Widget.Holo.TimePicker'.
Edit 2 A couple of the questions I've viewed to try to solve this:
- How can I override TimePicker to change text color - I think this question gets as close to an answer, but I'm not entirely sure what I need to do? Do I need to import the android TimePicker style into my project?
- https://stackoverflow.com/questions/24973586/set-textcolor-for-timepicker-in-customized-app-theme - No answer is given.
- How can i change the textcolor of my timepicker and datepicker? - Tried the 0 votes answer, but it didn't work.
- How to change the default color of DatePicker and TimePicker dialog in Android? - Again can't find the TimePicker in a similar way.
- Android - How do I change the textColor in a TimePicker? - Again, can't find the actual TimePicker parent.
These are probably the best questions/answers to my problem, but none of them help me. It would be nice to get a definitive answer on this.