【问题标题】:TextInput unwanted UnderlineTextInput 不需要的下划线
【发布时间】:2018-07-14 22:12:19
【问题描述】:

我正在开发一个包含一些文本字段 (textInput) 的项目。我在这里遇到了 textInput 字段的问题。当我在 textInput 字段中输入时,文本有一个下划线,当我点击空格时它变得更暗,我想从中删除该下划线。

这是一个截图:

这是我的代码:

<TextInput
  style={Style.InputStyle}
  multiline={true}
  placeholderTextColor={'#DC1938'}
  placeholder={'Name'}
  spellCheck={false}
  underlineColorAndroid='rgba(255,0,0,0.3)'
  inlineImageLeft='userred'
  inlineImagePadding={25}
  padding={15}
/>

【问题讨论】:

  • 您需要提供一些代码。您的文本输入中的样式是什么?
  • Harikrishnan ,看看我下面的答案,它会解决你的问题。
  • 看我需要红色的基线,但不想要下划线
  • 在实现任何组件之前,请仔细阅读其docs
  • @HarikrishnanS 你能从 TextInput 中删除下划线吗?

标签: react-native textinput underline


【解决方案1】:

尝试关注道具。

spellCheck={false}
autoCorrect={false}

请参考以下链接:

disable spellcheck in react-native TextInput

【讨论】:

  • 查看禁用拼写检查不起作用。我仍然遇到同样的问题
  • 不工作 :( :(
【解决方案2】:

大家好,我找到了答案,它是 autoCorrect 道具。我禁用了它,是的,它起作用了!

【讨论】:

    【解决方案3】:

    使用 underlineColorAndroid 道具

    <TextInput underlineColorAndroid='transparent'
           placeholder="type here ..">
       This is some text you want to render
    </TextInput>
    

    可以在here 找到发生这种情况的解释。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-10
      • 1970-01-01
      • 2016-08-14
      • 2017-12-18
      • 2019-02-03
      • 2019-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多