Flakx
Flakx

Reputation: 1112

NativeScript button text colour

I'm trying to style a button text colour but it wont change from blue. My html file:

<StackLayout>
    <Label text="Username" textWrap="true"></Label>
    <TextField hint="Enter Username" text=""></TextField>
    <Label text="Password" textWrap="true"></Label>
    <TextField hint="Enter your password." text="" secure="true"></TextField>
    <Button text="Sign in"></Button>
</StackLayout>

CSS:

button {
    color: #fff;
    font-size: 14;
    background-color: #000;
    border-radius: 20;
    text-transform: uppercase;
    padding:10;
    margin: 10 0;
}

however the button text colour always remains blue, and i can't seem to get it to be white.

Upvotes: 0

Views: 1735

Answers (2)

Nikolay Tsonev
Nikolay Tsonev

Reputation: 1919

In case you want to change text color of a Button, while text-transform has been set to uppercase or lowercase, the color of the text would not be applied. This is an issue only for iOS. In regard to that I opened new issue in NativeScript repo in GitHub #2601

Upvotes: 1

Osei Fortune
Osei Fortune

Reputation: 831

Since you are styling using the element you should try capitalizing button ->

Button{
  color: #fff;
    font-size: 14;
    background-color: #000;
    border-radius: 20;
    text-transform: uppercase;
    padding:10;
    margin: 10 0;
}

Upvotes: 1

Related Questions