ios - 样式输入占位符 R

标签 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 上,需要供应商前缀。

最佳答案

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/

相关文章:

ios - 将 4 个数字的字符串解析为 CGRect

javascript - 类型错误 : Cannot read property 'language' of undefined

react-native - React Navigation 5.x 嵌套抽屉导航无法从菜单按钮打开

css - react native : Text component style

ios - NSFetchRequest 两个实体并将它们放入 NSMutableArray

ios - 当推送到另一个 ViewController 时如何隐藏 UINavigationBar?

validation - React Native 输入组件仅接受数值

facebook - 我们如何使用 React Native 的 v0.27.0 中引入的 SwipeableRow(或 SwipeableListView)?

ios - 使用 iOS APP 的包标识符作为密码是否安全?

javascript - 从 iOS 浏览器中的后退缓存检索页面时持续触发的事件