2016-12-26 142 views
0

当前日期选择器是look like this如何更改默认日期选择器中的日期颜色

我想改变颜色日期颜色(当前设置为黑色。)

日期选择器主题。

<style name="myDatePickertheme" parent="Theme.AppCompat.Light.Dialog"> 
      <item name="android:headerBackground">@color/white</item> 
      <item name="android:textColorPrimary">@color/primary_text</item> 
     </style> 

解决方案的尝试:

 <item name="colorAccent">@color/white</item> 
在定制主题

民API = 17

应用主题

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> 
     <!-- Customize your theme here. --> 
     <item name="android:background">@color/primary_background</item> 
     <item name="android:colorPrimaryDark">@color/primary_background</item> 
     <item name="android:navigationBarColor">@color/primary_background</item> 
     <item name="android:popupBackground">@color/primary_background</item> 
     <item name="android:alertDialogTheme">@style/myDialog</item> 
     <item name="android:datePickerDialogTheme">@style/myDatePickertheme</item> 

    </style> 

任何暗示?

+0

你有没有试过答案[这里](http://stackoverflow.com/a/29014475/6155248)?希望它能帮助你! –

+0

是的,我试过..但没有帮助。 @TahmidRahman –

+0

日期选择器总是在您的应用主题中选择colorPrimary和colorAccent。请检查你是否有相同的颜色我的日历? – Nithinlal

回答

0

您会尝试创建自定义datePicker吗?您可以尝试this的解决方案?

+0

感谢这个解决方案,,我认为如果没有发生,这将是最后的解决方案。我认为要改变字体颜色,简单的改变将会起作用。 –

相关问题