GrapeJam
GrapeJam

Reputation: 181

React Native: Unable to change color of text within <TextInput> component

I'm not sure why but when using the <TextInput> component I am unable to alter the color of the input text using the standard style={{color: '#HEX'}}.

Here is an example:

          <TextInput
            style={{
              backgroundColor: 'transparent',
              color: '#fff',
              borderBottomWidth: 0,
            }}
            keyboardAppearance={'dark'}
            keyboardType={'numeric'}
            selectionColor='#fff'
            underlineColor="rgba(0,0,0,0)"
            underlineColorAndroid="rgba(0,0,0,0)"

            placeholderTextColor="#fff"

          />

There is also a very annoying purple underline which I can not seem to get rid of. Is there some kind of special property I need to be using for this?

Upvotes: 3

Views: 939

Answers (1)

Marik Ishtar
Marik Ishtar

Reputation: 3049

For the text color try this theme={{ colors: { text: '#fff' } }}; and for the underline try autoCorrect={false}

code


<TextInput
   theme={{ colors: { text: '#fff' } }}
   autoCorrect={false}
  />

Upvotes: 1

Related Questions