Yes see https://facebook.github.io/react-native/docs/textinput.html#style
and placeholderTextColor props
This doesn't work?
Never mind, you can achieve this via textInputProps
@nica0012 can you provide an example of how you made it work? I can't figure out how to style the placeholder.
@nica0012 can you provide an example of how you made it work? I can't figure out how to style the placeholder.
You want to pass the textInputProps as a prop to the GooglePlacesAutocomplete. Not into the styles obj like you pass most of the other styling. For example see below:
fetchDetails={true}
query={{
key: '...',
language: 'en',
}}
textInputProps={{ placeholderTextColor: 'pink' }}
styles={{
container: {
backgroundColor: theme.color.screen,
},
textInput: {
backgroundColor: theme.color.secondaryScreen,
color: theme.color.boneIcon,
},
textInputContainer: {
backgroundColor: theme.color.screen,
},
}}
onFail={(error) => console.log('error:', error)}
/>
Most helpful comment
You want to pass the textInputProps as a prop to the GooglePlacesAutocomplete. Not into the styles obj like you pass most of the other styling. For example see below:
fetchDetails={true}
query={{
key: '...',
language: 'en',
}}
textInputProps={{ placeholderTextColor: 'pink' }}
styles={{
container: {
backgroundColor: theme.color.screen,
},
textInput: {
backgroundColor: theme.color.secondaryScreen,
color: theme.color.boneIcon,
},
textInputContainer: {
backgroundColor: theme.color.screen,
},
}}
onFail={(error) => console.log('error:', error)}
/>