Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactNative TextInput placeholderTextColor doesn't seem to be working

Tags:

react-native

It seems like such a simple thing, I don't see how I'm not getting this right, but placeholderTextColor on a ReactNative TextInput isn't doing anything for me.

http://facebook.github.io/react-native/docs/textinput.html#placeholdertextcolor

<TextInput     style={styles.input}     placeholder="Foobar"     placeholderTextColor="#FFFFFF"/> 

does nothing....

like image 756
nicholas Avatar asked Apr 15 '15 19:04

nicholas


People also ask

How do I know if TextInput is focused?

To check if an input field has focus with JavaScript, we can use the document. activeElement property to get the element in focus. to add an input. to check if the input element is focused.

How do you style TextInput placeholder in React Native?

To change the styling of TextInput placeholder in React Native, we can set the placeholderTextColor prop. to set the placeholderTextColor to 'red' to set the placeholder color of the input to red.

How do I clear TextInput in React Native?

To clear React Native TextInput, we can set the value with a state and clear the state. to set the value prop to val . And we set onChangeText to setVal to set val to the inputted value. Next, we add a Button with the onPress prop set to a function that set val to an empty string with setVal .


1 Answers

This works -

<TextInput   placeholder="Enter password"   placeholderTextColor="white" /> 

Hope it helps! Cheers!

like image 54
mutp Avatar answered Nov 03 '22 11:11

mutp