3

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?

1 Answer 1

1

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}
  />

Sign up to request clarification or add additional context in comments.

3 Comments

You're a hero - the color change worked - unfortunately the autoCorrect={false} did not manage to fix the purple underline though
check this answer might help: stackoverflow.com/questions/40478246/…
Unfortunately not - it's an issue on iOS for me. I will give you the answer for fixing the text coloring though :) Thanks for your help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.