本机基础 <Input> 带一行

native base <Input> with a line

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

   <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 作为属性传递,但我收到重载错误,因为这些属性在 < Input >

上不存在

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

也许可以尝试在外部添加带有 regular 的项目标签?

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

underline default?

To use the underlined textbox, include the underline prop with Item.

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

DOC