Skip to content

ListPicker foreground color doesnt change #3218

@tsonevn

Description

@tsonevn

From @u14040426 on November 22, 2016 15:24

Hi I am having a problem, where my listpicker cant change the color of the text, it remains the default black. I would like it to be white, as the background is dark.

example.html

<StackLayout class="background">
    <Label class="heading-labels" text="Gender" textWrap="true" horizontal-alignment="center"></Label>
    <ListPicker #picker
                class="list-picker"
                [items]="genders"
                [(ngModel)]="selectedIndex">
    </ListPicker>
    <Button class="submit-button" text="Next" (tap)="nextPage()"></Button>
</StackLayout>

example.css

StackLayout {
    height: 450;
    margin-top:0;;
    margin-left: 30;
    margin-right: 30;
    padding-bottom: 15;
}
.background{
    background-color: transparent;
    color:white;
}

.submit-button{
    color:white;
    background-color: #CB1D00;
}

.heading-labels{
    color:white;
    text-align: center;
    font-size: 25;
}

.list-picker{
    color:white;
}

example.ts

import {Component, OnInit} from "@angular/core";
import {DietService} from "../../../service/DietService/diet.service";
import {Page} from "ui/page";

@Component({
    selector: "gender",
    templateUrl: "pages/setup/gender/gender.component.html",
    styleUrls: ["pages/setup/gender/gender.component.css", "pages/setup/setup.css"]
})
export class GenderComponent implements OnInit{
    private genders:Array<string> = ["Male", "Female"];
    private selectedIndex:number;
    constructor(private dietService: DietService, private page: Page) {
    }

    ngOnInit(){
        this.page.actionBarHidden = true;
        this.page.backgroundImage = "res://rfgfitness";
        this.initData();
    }

    public initData(){

    }

    public nextPage(){
        console.log("Next Page");
    }
}

Copied from original issue: NativeScript/nativescript-angular#549

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions