gpt4 book ai didi

react-native - 如何更改使用 React Native 创建的 android 应用程序中的占位符颜色

转载 作者:行者123 更新时间:2023-12-03 14:15:42 25 4
gpt4 key购买 nike

我正在使用 React Native 创建一个 Android 应用程序,其中有一个表单。占位符甚至没有出现在 textInput 字段中,所以我想改变占位符的颜色,但我不知道该怎么做。文档提到了一些我不明白的方式。

这是代码:

  <TextInput
secureTextEntry={secureTextEntry}
style={inputStyle}
placeholder={placeholder}
value={value}
onChangeText={onChangeText}
/>

inputStyle: {
color: '#000',
paddingRight: 5,
paddingLeft: 5,
fontSize: 18,
lineHeight: 23,
flex: 2,
}

我也试过:
  <TextInput
placeholderTextColor="blue"
style={inputStyle}
placeholder={placeholder}
value={value}
onChangeText={onChangeText}
/>


  inputStyle: {
color: '#000',
paddingRight: 5,
paddingLeft: 5,
fontSize: 18,
lineHeight: 23,
flex: 2,
placeholderTextColor: '#333'
}

最佳答案

像这样:

<TextInput
placeholder="something"
placeholderTextColor="#000"
/>

关于react-native - 如何更改使用 React Native 创建的 android 应用程序中的占位符颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44739331/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com