【问题标题】:multiple inputs in native base本机基础中的多个输入
【发布时间】:2018-08-28 06:29:04
【问题描述】:

我有一个反应原生项目并使用“native-base”。我想要这样的输入

谁能帮忙?

【问题讨论】:

  • 实现这一目标您面临的问题是什么?
  • @SupriyaKalghatgi 银行卡号!
  • 您说“我想要这样的输入:,那么当您尝试编写此代码时遇到了什么问题?

标签: react-native native-base


【解决方案1】:

可能对您的要求有所帮助

import React, { Component } from "react";
import { Container, Header, Content, Item, Input } from "native-base";
export default class RoundedTextboxExample extends Component {
render() {
return (
  <Container>
    <Header />
    <Content
      contentContainerStyle={{
        flexDirection: "row",
        justifyContent: "space-between",
        marginTop: 20,
        borderColor: "black",
        borderWidth: 3,
        margin: 2,
        padding: 20
      }}
    >
      <Item rounded style={{ width: "23%", borderColor: "red" }}>
        <Input placeholder="Rounded" />
      </Item>
      <Item rounded style={{ width: "23%" }}>
        <Input placeholder="Rounded" />
      </Item>
      <Item rounded style={{ width: "23%" }}>
        <Input placeholder="Rounded" />
      </Item>
      <Item rounded style={{ width: "23%" }}>
        <Input placeholder="Rounded" />
      </Item>
    </Content>
  </Container>
);
}
}

【讨论】:

    【解决方案2】:

    NativeBase 可以做到这一点,只需将您选择的宽度提供给 Item

    这个截图中提到的输入是每个输入给定的宽度值

    【讨论】:

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