是否可以在 React Native 上设置输入占位符的样式。这是一个输入。
<TextInput style={styles.input}
onChangeText={(password) => this.setState({password})}
value={this.state.password}
placeholder='Password'
secureTextEntry={true}/>
如何定义styles.input
来编辑占位符的文本颜色?
在 CSS 上,需要供应商前缀。
最佳答案
在 TextInput 文档中有一个名为 placeholderTextColor 的 Prop 。您实现此属性的方式如下:
<TextInput style={styles.input}
onChangeText={(password) => this.setState({password})}
value={this.state.password}
placeholder='Password'
placeholderTextColor'#COLORHERE'
secureTextEntry={true}/>
只在第一次实现时简要介绍文档,但 React Native 的文档涵盖了很多内容。
关于ios - 样式输入占位符 R,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36411355/