1

[How can i change the background colour which is white , i want to set it according to my theme colour (example. orange, blue , default)

](https://i.stack.imgur.com/p4xS6.png)

I have tried few code like

 <item name="android:background">#0BBCED</item>

in styles.xml file. I don't know that it is right way or not. Can anyone help me.

1 Answers1

1
    You can add <item name="android:datePickerDialogTheme">@style/Dialog.Theme</item>
    
    in your style.xml under Base theme like bellow
 
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:textColor">#000000</item>
        <item name="android:datePickerDialogTheme">@style/Dialog.Theme</item>
    </style>
    
    
    and you add new style like below
   
<!-- Configuration for Dialog.theme. -->
<style name="Dialog.Theme" parent="Theme.AppCompat.Light.Dialog">
  <!-- BackgroundColor of the date modal -->
    <item name="colorAccent">#0066F5</item>
    <!-- textColor of the date modal -->
    <item name="android:textColorPrimary">#000000</item>
</style>

hope this is working

Mahammad Momin
  • 600
  • 2
  • 13
  • Thankyou for replyiing, but this code works fine for "react-native-datepicker" . The plugin i have used is "react-native-date-picker" and this does not work for it. – Manali Tailor Dec 07 '22 at 11:34
  • @ManaliTailor you can only change the color of the text, also it's an open issue for this package, if possible you can use a different package. – Ankit Vora Dec 08 '22 at 06:53
  • Yes you're right, i had to change the package only. – Manali Tailor Dec 26 '22 at 04:35