样式输入占位符R.

时间:2016-04-04 19:34:31

标签: ios react-native

是否可以在React Native上设置输入占位符的样式。这是一个输入。

 <TextInput style={styles.input}
            onChangeText={(password) => this.setState({password})}
            value={this.state.password}
            placeholder='Password'
            secureTextEntry={true}/>

如何定义styles.input来编辑占位符的文字颜色?

在css上,需要供应商前缀。

2 个答案:

答案 0 :(得分:1)

TextInput 文档中,有一个名为 placeholderTextColor 的道具。您实现此属性的方式如下:

<TextInput style={styles.input}
        onChangeText={(password) => this.setState({password})}
        value={this.state.password}
        placeholder='Password'
        placeholderTextColor'#COLORHERE'
        secureTextEntry={true}/>

在首次实施文档时,只需简要介绍文档,但React Native的文档涵盖了很多内容。

答案 1 :(得分:0)

这就是我在同一个.js文件中的拥有方式:

{{1}}
相关问题