【发布时间】:2019-03-01 01:14:57
【问题描述】:
我正在我的 Android 上开发 React native 和 Expo XDE,我希望这些文本 - “用户名”和“密码”将位于其 TextInputs 的右侧(因为我用希伯来语编写),所以它将在两行中,而不是在下面的屏幕截图中。 这是代码:
<View style={styles.container}>
<Text > Travel </Text>
{/* <View style={styles.row}>
<View style={styles.inputWrap}> */}
<Text> Username </Text>
<TextInput
style={styles.input}
onChangeText={text => this.setState({ username: text })}
value={this.state.username}
/>
<Text> Password </Text>
<TextInput
style={styles.input}
onChangeText={text => this.setState({ password: text })}
value={this.state.password}
secureTextEntry={true}
/>
This is how its look now: the main screen with login or register
我尝试了这些样式代码,但没有成功,它在 android 上搞得一团糟,一切都飞了:
input: {
height: 40,
width: 180,
borderColor: "gray",
borderWidth: 1
},
inputWrap: {
flex: 1,
borderColor: "#cccccc",
borderBottomWidth: 1,
marginBottom: 10
},
row: {
flex: 1,
flexDirection: "row"
}
我也想在顶部设计标题“Travel”,但我 这么多次都没有成功,还是一样。
你能帮我解决这些问题吗?如果需要更多详细信息,请告诉我。 提前致谢。
【问题讨论】:
标签: javascript css react-native styles stylesheet