2

I am unable to change background color of the layout in which ok and cancel buttons exist in timepickerdialog . What should I add or change .Also how can I change the textcolor of both ok and cancel buttons on timepickerdialog? I really appreciate any help.

My code:

<style name="Theme.MyTheme.TimePicker" parent="android:Widget.Material.Light.TimePicker">
    <item name="android:timePickerMode">clock</item>
    <item name="android:headerBackground">#ff555555</item>
    <item name="android:numbersTextColor">?android:attr/textColorPrimaryActivated</item>
    <item name="android:numbersInnerTextColor">?android:attr/textColorSecondaryActivated</item>
    <item name="android:numbersSelectorColor">?android:attr/colorControlActivated</item>
    <item name="android:numbersBackgroundColor">#ff555555</item>
    <item name="android:amPmTextColor">?android:attr/textColorSecondary</item>
</style>
jason
  • 3,820
  • 10
  • 46
  • 115
  • Check [http://stackoverflow.com/questions/26015798/change-timepicker-text-color](http://stackoverflow.com/questions/26015798/change-timepicker-text-color) – Chintan Rathod Sep 15 '15 at 09:21

1 Answers1

2

please try below code . hope it will help you

<style name="DialogTheme" parent="**Theme.AppCompat.Light**">
    <item name="colorAccent">@color/blue</item>
</style>

or you can try below code also

<style name="AppTheme" parent="...">
  ...
  <item name="android:timePickerDialogTheme">@style/AlertDialogCustom</item>
  <item name="android:datePickerDialogTheme">@style/AlertDialogCustom</item>
  <item name="android:alertDialogTheme">@style/AlertDialogCustom</item>
</style>

<style name="AlertDialogCustom" parent="android:Theme.Material.Light.Dialog.Alert">
  <item name="android:colorPrimary">#00397F</item>
  <item name="android:colorAccent">#0AAEEF</item>
</style>
Mobile Team ADR-Flutter
  • 12,062
  • 2
  • 29
  • 49