React-native: [Android][TextInput] Remove underline option?

Created on 20 Jan 2016  ·  26Comments  ·  Source: facebook/react-native

I was working around it by setting the underlineColorAndroid to the same color as the background, but when you focus, the underline color changes to a teal color no matter what.

Locked

Most helpful comment

Have you tried underlineColorAndroid='rgba(0,0,0,0)'?

All 26 comments

Hey rclai, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!

Have you tried underlineColorAndroid='rgba(0,0,0,0)'?

I'll give that a try when I get a chance.

Setting rgba(0,0,0,0) works for me. I was using #fff before with the same problem as @rclai

Cool, thanks guys.

I am also observing a similar problem and setting the underlineColorAndroid to rgba(0, 0, 0, 0) doesn't seem to help me. This is what I am observing.

This is how it appears to begin with which is good. Before I added underlineColorAndroid, there was an underline in the complete width of the text box which was gone once I added the underlineColorAndroid which is good.

screen shot 2016-10-10 at 3 09 34 pm

This is how it appears after adding some text. Notice an underline below the typed text. I want to get rid of that underline too. Do I need to set some other prop on the TextInput to get rid of that underline

screen shot 2016-10-10 at 3 09 51 pm

@varungupta85 autoCorrect={false} might help here.

@Sommerfeld Great, using autoCorrect={false} fixed it. Thanks a lot!

It seems that the autocorrect solution does not work when the TextInput is multiline (I have v0.33).

Are you aware of this? I suppose it is a bug?

The autocorrect solution does not skip the underlineColorAndroid step. The line seen in the image of @varungupta85 is not from the textInput itself it is from the autocorrect and would not have appear for the first word if he would have started typing a second one. (my guess, not tested, not 100% familiar with Android)

this should do the trick as per react-native TextInput documentation

<TextInput underlineColorAndroid='transparent'>

Before

image

After

image

underlineColorAndroid='transparent' works for me. At first, it does not work on android 6.0 emulator. Then run code on android 7.0 emulator, underline is dismiss. So, run on 6.0 again, it works. Maybe autoFocus={true} is setted, press R twice to reload JS failed.

underlineColorAndroid='transparent' definitely did the magic for me

underlineColorAndroid='transparent' is definitely the way to go.

underlineColorAndroid='transparent' worked for me with single line text.

To give in your Text input Use this Property Remove Under Line
<TextInput underlineColorAndroid="transparent" />

underlineColorAndroid="transparent" seems to disable the underline in all TextInput. How to selectively remove the underline for only a few TextInput?

i din't get u point

On Sat, Jan 28, 2017 at 1:44 PM, Vijay Thirugnanam <[email protected]

wrote:

underlineColorAndroid="transparent" seems to disable the underline in all
TextInput. How to selectively remove the underline for only a few TextInput?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/5424#issuecomment-275834770,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATmTnBGelNZEuYVeiBorH8eVS8iOpaM9ks5rWvj-gaJpZM4HIWcG
.

@lavarajallu Please ignore the comment, It seems to work now.

work for me

Type underlineColorAndroid='transparent' inside textinput its work 100%

Why is this not underlineColorAndroid="transparent" by default, this make sense for easy compatibility with iOS ?

Bcz when you install nodumodules default color in text Input comparing both
Platforms

On Tue, Feb 13, 2018 at 3:44 PM, Andréas Hanss notifications@github.com
wrote:

Why is this not underlineColorAndroid="transparent" by default, this make
sense for easy compatibility with iOS ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/5424#issuecomment-365216898,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATmTnDB8Rm-lysejiLABA1yOL_xpoHGYks5tUWCSgaJpZM4HIWcG
.

underlineColorAndroid='white' It's work for me 👯‍♂️

Thank you guys <3

Works fine now!

<TextInput underlineColorAndroid='transparent'> worked for me!

Was this page helpful?
0 / 5 - 0 ratings