【问题标题】:Native Base Input line height本机基本输入行高
【发布时间】:2018-05-01 06:24:18
【问题描述】:

我正在使用 Native Base Component Input 创建 TextInput,但显示的 lineheight 已损坏,无法显示完整的单词。 padding、margin、border、lineheight 在这里不起作用。

有人有这个解决方案吗?谢谢!

备注:只发生在android

        <Text style={styles.inputHeader}>My Name</Text>
        <Item regular>
          <Input style={{height:35,marginBottom:0 }} />
        </Item>

【问题讨论】:

  • 是安卓还是ios?
  • @Pritish Vaidya android,ios正常
  • 你弹出了吗?此问题已在 Native Base 2.4.0 中解决
  • 你应该在本地基础 github 上发布问题。你可以在这里得到快速的解决方案:github.com/GeekyAnts/NativeBase/issues

标签: react-native native-base


【解决方案1】:

我建议将其包装在 父容器包装器 中的 Form 标记内,以继承在 Item 中分配给它的样式

<Form>
    <Label>My Name</Label>
    <Item regular>
        <Input style={{ height: 35, marginBottom: 0 }} />
    </Item>
</Form>

【讨论】:

    【解决方案2】:

    为输入提供填充

    {padding:2}
    

    【讨论】:

      【解决方案3】:

      无需嵌入内联样式

      NativeBase 解决了这个问题

      尝试在您的项目中更新 NativeBase,并确保您弹出主题以找到修复程序

      【讨论】:

        猜你喜欢
        • 2020-08-12
        • 1970-01-01
        • 2020-08-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多