如图,下面第一张是Android5.0的DatePickerDialog,第二张是Android6.0的DatePickerDialog,如何能够统一一下在Android6.0使用5.0的样式,谢谢
PHP中文网2017-04-18 09:06:16
The following answer is for the situation of downward unification to API Level 9:
I can only tell you that Android & Support cannot unify the styles. If you don’t believe me, you can check out Platform-Source and Platform-XML.
When implementing DatePickerDialog, each version basically uses some new APIs of the corresponding version, and the most important thing is that the specific implementation methods are different, which is destined to be impossible to unify. For example: the new version adds a new package: android.icu.*
, all about time and date localization processing.
If you must unify, then rewrite DatePicker yourself. The workload is not small anyway. Otherwise, go to github to find the wheel.