react-native TextInput占位符不可见

Cod*_*eBy 4 javascript node.js react-native

我做简单屏幕只包含一个带占位符的TextInput,但显示占位符.怎么了?

MyComponent的:

render() {
  <TextInput
    placeHolder="placeholder"
  />
}
Run Code Online (Sandbox Code Playgroud)

index.js:

export default () => {
  <MyComponent />
}
Run Code Online (Sandbox Code Playgroud)

将TextInput包装到View中无济于事.

Fer*_*gre 15

看起来你拼错的道具placeholderplaceHolder.请参阅https://facebook.github.io/react-native/docs/textinput.html#placeholder.


Zen*_*tzi 6

有些人像我一样,可能会忘记他们不使用默认颜色。确保调整placeholderTextColor属性以对比背景颜色