简体   繁体   English

未聚焦时更改边框线 colors (react-native-paper)

[英]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:我试图改变:

  • underlineColor props. underlineColor 道具。
  • borderColor, backgroundColor, color in styles, but nothing is working so far. borderColor、backgroundColor、styles 中的颜色,但到目前为止没有任何效果。

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.

相关问题 react-native-paper SegmentedButtons 中存在问题 - There is an issue in react-native-paper SegmentedButtons react native:Searchbar的背景(react-native-paper) - react native: background of Searchbar (react-native-paper) React Native react-native-paper 按钮具有更大的高度 - React native react-native-paper button with greater height React-Native-Paper 主题不会使用自定义字体 - React-Native-Paper Theme won't use Custom Fonts ZIndex 仅与 Android 中的任何 react-native-paper 组件重叠 - ZIndex overlapping with any react-native-paper component in Android only 如何在 react-native-paper 中使图标旋转? - How to make icon spin in react-native-paper? 减少 react-native-paper TextInput 的高度和垂直填充 - Reduce height and vertical padding for a react-native-paper TextInput React-native 与故事书问题 react-native-vector-icons 和 react-native-paper - React-native with storybook problem react-native-vector-icons and react-native-paper 如何使用 react-native-paper Modal 从下到上生成模态 animation? - How to produce a modal bottom to top animation with react-native-paper Modal? 如何将 css 应用于<text>内部组件<card.content> react-native-paper 中的组件?</card.content></text> - How to apply css to the <Text> component inside <Card.Content> component from react-native-paper?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM