Open veeravetrivel opened 4 years ago
You'll have to style it the Android theme way.
I'll give you an example of how I got it working.
It would be nice if something like this was in the readme because this took me a while to get working, googling this stuff was a pain.
## App_Resources\Android\src\main\AndroidManifest.xml ##
<application
. . .
android:theme="@style/AppTheme">
## App_Resources\Android\src\main\res\values\styles.xml ##
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppThemeBase" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
<item name="colorPrimary">@color/ns_primary</item>
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
<item name="colorAccent">@color/ns_accent</item>
</style>
<style name="AppTheme" parent="AppThemeBase">
</style>
. . .
</resource>
## App_Resources\Android\src\main\res\values-v21\styles.xml ##
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="AppThemeBase">
<item name="android:datePickerDialogTheme">@style/DatePickerDialogTheme</item>
<item name="android:datePickerStyle">@style/CalendarDatePicker</item>
</style>
<style name="DatePickerDialogTheme" parent="android:Theme.Material.Light.Dialog">
<item name="android:colorAccent">#FF0000</item>
<item name="android:buttonBarPositiveButtonStyle">@style/DialogButtonStyle</item>
<item name="android:buttonBarNegativeButtonStyle">@style/DialogButtonStyle</item>
<item name="android:buttonBarNeutralButtonStyle">@style/DialogButtonStyle</item>
</style>
<style name="DialogButtonStyle" parent="android:Widget.Material.Light.Button">
<item name="android:textColor">#FFFFFF</item>
<item name="android:backgroundTint">#FF0000</item>
</style>
<style name="CalendarDatePicker" parent="android:Widget.Material.Light.DatePicker">
<item name="android:datePickerMode">calendar</item>
</style>
. . .
</resource>
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
tns --version
to fetch it) 6.7.8node_modules/tns-core-modules/package.json
file in your project) "tns-core-modules": "6.5.0","tns-android"
and"tns-ios"
properties in thepackage.json
file of your project) "tns-android": { "version": "6.5.3" }package.json
file of your project and paste your dependencies and devDependencies here) dependencies "@angular/animations": "9.1.0", "@angular/common": "9.1.0", "@angular/compiler": "9.1.0", "@angular/core": "9.1.0", "@angular/forms": "9.1.0", "@angular/platform-browser": "9.1.0", "@angular/platform-browser-dynamic": "9.1.0", "@angular/router": "9.1.0", "@nativescript/angular": "~9.0.0", "@nativescript/core": "~6.5.5", "@nativescript/schematics": "9.0.0", "@nativescript/theme": "~2.2.1", "nativescript-angular": "9.0.0-next-2019-11-12-155500-01", "tns-core-modules": "6.5.0", devDependencies "@angular-devkit/build-angular": "0.901.0", "@angular/cli": "9.1.0", "@angular/compiler-cli": "9.1.0", "@angular/language-service": "9.1.0", "@nativescript/schematics": "~2.0.0", "@nativescript/tslint-rules": "~0.0.5", "@ngtools/webpack": "9.1.0",Please, tell us how to recreate the issue in as much detail as possible.
Describe the steps to reproduce it.
Date and Time picker working are working fine as per the guideline #8 . But 'ok' and 'cancel' button color is not set. How to set color and change text.
@davecoffin @pedromorgan @Logikgate @KevinBeckers @sebj54