tcomb-form-native icon indicating copy to clipboard operation
tcomb-form-native copied to clipboard

Underline on android

Open cafeasia3 opened this issue 7 years ago • 13 comments

I am Using

  • tcomb-form-native v0.6.16
  • react-native v0.55.4

There is underline on the field on android image

Since underlineColorAndroid isnt supported on this version. How to remove The underline? Any idea?

cafeasia3 avatar Sep 05 '18 08:09 cafeasia3

Hi, I just had the same problem. I've solved it by using auto placeholders as described in https://github.com/gcanti/tcomb-form-native/tree/v0.6.15#labels-and-placeholders

fermuch avatar Sep 07 '18 21:09 fermuch

Hmm, I was not able to solve this with auto: 'placeholders' on my forms. Also interested in solutions.

tonycoco avatar Sep 14 '18 05:09 tonycoco

From the README.md...

underlineColorAndroid is not supported now on tcomb-form-native due to random crashes on Android, especially on ScrollView. See more on: https://github.com/facebook/react-native/issues/17530#issuecomment-416367184

Commits are in PR #520

tonycoco avatar Sep 14 '18 16:09 tonycoco

Hi, I've got the same problem and I can't figure out to find a workaround. The auto: 'placeholders' trick don't work on 0.6.20 @fermuch can you provide a sample of your <Form /> options and stylesheet props ?

CharlyPoppins avatar Oct 14 '18 10:10 CharlyPoppins

Hi guys, if you need to remove the underline or change the color, you have to change native code, on styles.xml file. See more:

https://developer.android.com/guide/topics/ui/look-and-feel/themes https://github.com/facebook/react-native/issues/17530#issuecomment-416367184

a-morenovalls avatar Oct 16 '18 11:10 a-morenovalls

Thanks for the links, I tried do solve this by different way in the style.xml but I didn't manage to modify the text edit field underline. Also I'm on a project ejected to ExpoKit maybe it's related.

CharlyPoppins avatar Oct 17 '18 17:10 CharlyPoppins

Thanks for the links, I tried do solve this by different way in the style.xml but I didn't manage to modify the text edit field underline. Also I'm on a project ejected to ExpoKit maybe it's related.

Maybe ExpoKit is the problem. Here is working with react-native init project.

a-morenovalls avatar Oct 19 '18 10:10 a-morenovalls

hi, same problem here..im not using Expo either. so anyone have solution?

mohd-aidi avatar Oct 19 '18 14:10 mohd-aidi

Same issue here...I could not get @hodgef solution to work on 0.6.20.

I am not using expo. RN 46.4

jamesholcomb avatar Oct 26 '18 04:10 jamesholcomb

It seems that with the method above the underline comes and goes between builds. I've deleted the post. It would be great if this could be fixed without modifying native code, as it seems overkill to eject Expo because of an underline issue..

hodgef avatar Oct 26 '18 19:10 hodgef

I was able to get @Moreno97 fix to work, specifically his recommendation to update styles.xml:

Fortunately, there is another way to remove underlines from TextInput components on Android. You can add a line to the android/app/src/main/res/values/styles.xml file:

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowExitAnimation">@android:anim/fade_out</item>
        <item name="android:windowBackground">@drawable/splash_screen</item>
+       <item name="android:editTextBackground">@android:color/transparent</item>
    </style>
</resources>

jamesholcomb avatar Oct 28 '18 16:10 jamesholcomb

@jamesholcomb been searching for hours, and it did the trick ! thanks a lot !

shide1989 avatar Oct 29 '18 16:10 shide1989

i am using expo on a project built with crna i ama facing the same issue mentioned above putting auto: 'none' is not removing the underline from the inputs. has there been any updates or any help will be appreciated.

this.state = {
      options: {
        auto: 'none'
      }
}

<Form
     ref="form"
      type={Person}
      value={this.state.form}
      options={this.state.options}
      onChange={this.onChange}
 />

ydvsailendar avatar Mar 07 '19 08:03 ydvsailendar