本机基础中的多个输入

时间:2018-08-28 06:29:04

标签: react-native native-base

我在react native中有一个项目,并使用“ native-base”。我想输入像这样的enter image description here

有人可以帮忙吗?

3 个答案:

答案 0 :(得分:0)

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

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

enter image description here

答案 1 :(得分:0)

可能对您的要求有所帮助

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>
);
}
}

**It's screenshot from my emulator**

答案 2 :(得分:-1)

如果您愿意使用本机以外的其他方式,请选择react-native-code-input