multiple inputs in native base

人盡茶涼 提交于 2019-12-24 06:06:29

问题


I have a project in react native and use "native-base". I want to have inputs like this

Can anyone help?


回答1:


May be it's helpful for your requirement

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:


Well thats possible with NativeBase, just give width of your choice to Item

The input mentioned in this screenshot is the width value given with each Input



来源:https://stackoverflow.com/questions/52051428/multiple-inputs-in-native-base

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!