【发布时间】:2019-06-07 08:59:46
【问题描述】:
我正在重新设置使用 NativeScript + Angular 制作的跨平台应用程序的样式,并且我想在将数据放入文本字段时更改其边框颜色。
我试过了,但是不行
TextField {
margin-bottom: 10;
border-radius: 4;
background: #FFFFFF;
border-width: 0.5;
border-color: #C4C4C4;
box-sizing: border-box;
}
TextField:focus{
border-color: red;
}
这是 login.component.html 的一部分:
<label text="Email"></label>
<TextField
hint="mario.rossi@gmail.com"
keyboardType="email"
autocorrect="false"
autocapitalizationType="none"
[(ngModel)]="user.email"
class="input"></TextField>
<label text="Password"></label>
<TextField
hint="Password"
secure="true"
[(ngModel)]="user.password"
class="input"></TextField>
我该怎么办? 这是Playground
【问题讨论】:
-
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers。请在提出问题时提供您的问题的minimal reproducible example,并在发布之前阅读How to Ask。 -
现在可以了吗?还是您需要更多信息?
-
为什么它不起作用,告诉我一个原因?
-
因为我在里面写的时候,边框颜色没有变化。它保持默认颜色
-
使用输入而不是文本字段。输入[type="text"]:focus{ 边框颜色:红色; }
标签: nativescript nativescript-angular