In my setting page, a Settings.vue
file I've my DatePicker
<template>
<Page>
<DatePicker/>
</Page>
</template>
I need to change the default style.
Note: actually I'm working specifically on Android, but please, answer keeping in mind I need the same colors on both Android and iOs; thanks,
I tried (in app.scss file
Datepicker {
color: white;
}
Without success, as you can see my android emulator is using a near-black color.
Following this guide, I changed colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ns_primary">#577eac</color>
<color name="ns_primaryDark">#577eac</color>
<color name="ns_accent">#ffffff</color>
<color name="ns_blue">#272734</color>
</resources>
Then I changed styles.xml
<style name="AppTheme" parent="AppThemeBase">
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
</style>
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
<item name="android:datePickerMode">spinner</item>
<item name="colorPrimary">@color/ns_primary</item>
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
<item name="colorAccent">@color/ns_accent</item>
</style>
Note: I specified I want the spinner, but it's actually the default, I think.
I did a clean run
tns debug --hmr --clean
The problem: actually, the android DatePicker
is still rendered using default colors, no my primary or accent colors as defined.
Similar question:
- Nativescript Datepicker change text color - Uses the same solution, so it's useless for me because this solution doesn't works (for me, actually)