React native 我无法在React Native中垂直对齐我的登录表单
我无法在屏幕上垂直对齐我的登录表单 我正在使用nativebase 从React Native docs示例开始,我尝试了在SO和其他平台上提供的许多不同的解决方案 这是我的登录表。我去掉了不必要的部分React native 我无法在React Native中垂直对齐我的登录表单,react-native,layout,flexbox,styles,React Native,Layout,Flexbox,Styles,我无法在屏幕上垂直对齐我的登录表单 我正在使用nativebase 从React Native docs示例开始,我尝试了在SO和其他平台上提供的许多不同的解决方案 这是我的登录表。我去掉了不必要的部分 <Container> <Content> <Form style={formStyle}> <Item> <Icon /> <Input label="email" /> </Ite
<Container>
<Content>
<Form style={formStyle}>
<Item>
<Icon />
<Input label="email" />
</Item>
<Item>
<Icon />
<Input label="password" />
</Item>
<Button>
<Text>Login</Text>
</Button>
</Form>
</Content>
</Container>
在您的样式中使用
alignItems
:
formStyle: {
flex: 1,
flexDirection: "column",
justifyContent: "center",
alignItems: "center"
}
你到底想达到什么目标?目前情况如何?如果你的问题已经得到回答,请确保接受并投票支持答案,以供进一步参考。
formStyle: {
flex: 1,
flexDirection: "column",
justifyContent: "center",
alignItems: "center"
}