[英]Change border line colors when unfocused (react-native-paper)
I have a textinput that changes color if the conditions are met or not (green to brown and vice versa) when it is focused.我有一个文本输入,当它被聚焦时,如果满足或不满足条件(绿色到棕色,反之亦然),它会改变颜色。
I would like the colors to stay the same even when the input is unfocused.我希望 colors 即使在输入未聚焦时也能保持不变。
Focused and verifications not ok:重点和验证不正常:
Focused and verifications ok:重点和验证确定:
Unfocused verifications okay or not:无重点的验证是否可行:
My code:我的代码:
//Change brow to green, green to brown
const [inputColor, setInputColor] = useState("brown");
<TextInput
//{...}
theme={{
colors: {
primary: inputColor,
underlineColor: inputColor,
},
}}
/>;
I tried to change:我试图改变:
try underlineColor Type: string Inactive underline color of the input.试试 underlineColor 类型:字符串 输入的非活动下划线颜色。
You can try to change the placeholder color theme={{ colors: { primary: 'blue', placeholder: 'blue', }, }}
您可以尝试更改占位符颜色
theme={{ colors: { primary: 'blue', placeholder: 'blue', }, }}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.