【问题标题】:native base <Input> with a line带有一行的原生基础 <Input>
【发布时间】:2020-06-04 01:48:05
【问题描述】:

我正在使用本机基础的项目,并希望对其进行样式设置,使其有一条线。目前,它只是不可见的。我只能看到占位符文本,如果我更改背景颜色,那么我也可以看到。但是没有边界/线。我该如何解决这个问题?

   <Input style={styles.newFieldInput}
                      onChangeText={handleChange('phoneNumber') as (text: string) => void}
                      onBlur={handleBlur('phoneNumber') as (event: any) => void}
                      value={values.phoneNumber}
                      placeholder="49152901820"
                    />
 newFieldInput: {
    width: moderateScale(320),
    backgroundColor: 'white',
  },

我尝试将 roundedline 作为属性传递,但我收到重载错误,因为这些属性在

上不存在

另外,有什么方法可以在输入的开头添加图标吗?还是我必须将它包装在另一个组件中?

【问题讨论】:

    标签: javascript css typescript react-native native-base


    【解决方案1】:

    也许尝试在外面添加一个带有regular 的项目标签?

    <Item regular>
        <Input placeholder='Regular Textbox' />
    </Item>
    

    还是underline default

    要使用带下划线的文本框,请在 Item 中包含 underline 属性。

    <Item underline >
        <Input placeholder="Underline Textbox" />
    </Item>
    

    DOC

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-29
      • 1970-01-01
      • 2020-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多