问题
I'd like to create a DialogFragment or a Dialog with a TimePicker inside, just like in the following image. The problem is that my application is using the Holo.Light theme and then from there, I'm customizing it, but I can't find anything related to TimePicker.
Is it possible to assign a custom style to a TimePicker? I haven't found anything in the official Android documentation.
The following image is what I got so far, but still the TimePicker isn't in the color I want (it's the same orange as in the separator of the title) even tho in the XML I have it as it follows:
<TimePicker
android:id="@+id/picker"
style="@style/Checkmark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip" />
Any ideas, please? Thanks a lot in advance
回答1:
I use HoloEverywhere https://github.com/Prototik/HoloEverywhere to have native Holo elements in android 2.2 and up. You can style the picker easily if you use this library since it's open source and you get full access to the code.
Probably you don't need the whole library, it might be good to get only the TimePicker elements (beware of the dependency hell)
来源:https://stackoverflow.com/questions/18208082/creating-timepickerdialog-with-custom-style-in-android