0

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.

4

2 回答 2

1

由于您正在使用元素进行样式设置,因此您应该尝试大写button->

Button{
  color: #fff;
    font-size: 14;
    background-color: #000;
    border-radius: 20;
    text-transform: uppercase;
    padding:10;
    margin: 10 0;
}
于 2016-08-16T14:09:18.963 回答
1

如果您想更改 Button 的文本颜色,而 text-transform 已设置为大写或小写,则不会应用文本的颜色。这只是 iOS 的问题。关于这一点,我在 GitHub #2601的 NativeScript repo 中打开了新问题

于 2016-08-22T08:18:12.277 回答