本机基础中的多个输入
multiple inputs in native base
我在 React Native 中有一个项目并使用 "native-base"。我想要这样的输入
有人能帮忙吗?
NativeBase 可以做到这一点,只需将您选择的宽度提供给 Item
此截图中提到的输入是每个输入给出的宽度值
可能对您的要求有帮助
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>
);
}
}
我在 React Native 中有一个项目并使用 "native-base"。我想要这样的输入
有人能帮忙吗?
NativeBase 可以做到这一点,只需将您选择的宽度提供给 Item
此截图中提到的输入是每个输入给出的宽度值
可能对您的要求有帮助
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>
);
}
}