How to change the change Cancel and Ok buttons' color in the picker?

mhmdmhmd Member ✭✭
edited June 6 in Xamarin.Forms

I'm using a custompicker in my app and I need to change the cancel and ok buttons' color. I recently changed the whole theme of timepicker and datepicker for android by adding this code to the style file:

 <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
    <item name="android:timePickerDialogTheme">@style/TimePickerTheme</item>

item name="colorAccent">#039BE5</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
  </style>
  <style name="TimePickerTheme" parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">#039BE5</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
  </style>

Is that a similar code that I can add for the picker?

Best Answers

Answers

  • mhmdmhmd Member ✭✭

    I added these to my styles file and it didn't change:

    <style name="MyTheme" parent="@android:style/Theme.Material.Light">
      <item name="android:alertDialogTheme">@style/MyTheme.AlertDialog</item>
    </style>
    
    <style name="MyTheme.AlertDialog" parent="android:Theme.Material.Light.Dialog">
      <item name="android:colorAccent">#ff0000</item>
    </style>
    
Sign In or Register to comment.