【问题标题】:How to remove underline in TextInput (Expo - react native)?如何删除 TextInput 中的下划线(Expo - react native)?
【发布时间】:2021-10-16 03:09:31
【问题描述】:

我在 android 中有一个下划线问题,当我键入时,字母会被加下划线,如图所示。这在ios中不会发生。我尝试了以下属性,但没有任何效果。

underlineColorAndroid='transparent'
autoCorrect='false'

underlineColorAndroid - 如果设置为其他颜色,则我有一个双下划线(在下面的示例中,我设置为绿色,然后是透明的)。

这里我得到绿色和白色下划线。白色下划线仅在我输入的字母下方,我想去掉这个白色下划线

参考:https://reactnative.dev/docs/textinput

【问题讨论】:

    标签: reactjs react-native expo


    【解决方案1】:

    如果你使用正确的话:

    <TextInput
          underlineColorAndroid="transparent"
        />
    

    在我的情况下仍然无法正常工作,我只是解决了它。

    既然改变它的颜色是有效的,那么这个怎么样:

    underlineColorAndroid='rgba(0,0,0,0)' // make the numbers match the backround color.
    

    【讨论】:

    • 感谢您的回答,但不,不幸的是,这不起作用。通过这样做,我们可以隐藏其中一条长线,但不能隐藏字母下方的白线
    猜你喜欢
    • 2019-01-10
    • 2019-02-03
    • 2017-12-18
    • 1970-01-01
    • 1970-01-01
    • 2019-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多