3

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.

enter image description here

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:

realtebo
  • 23,922
  • 37
  • 112
  • 189
  • I had a issue in my project where my folder structure was broken. What happened was that I had dupplicate files for my colors and resources in Android. Somehow I had them in "App_Resources/Android" AND "App_Resources/Android/src/main/res". Maybe you have this issue aswell? – Mennolp May 15 '19 at 13:37

0 Answers0