我有两个视图,在我的视图中,每个视图中有两个 TextInput 文件,问题是在我的每个文本输入文件之间有很多空间,如何填补它们之间的空白。以下是我的看法:
<View style={styles.inputContainer}>
<Image style={styles.inputIcon} source={require('../assets/email.png')}/>
<TextInput style={styles.inputs}
placeholder="Email"
keyboardType="email-address"
underlineColorAndroid='transparent'
onChangeText={(email) => this.setState({email})}/>
</View>
<View style={styles.inputContainerx}>
<Image style={styles.inputIcon} source={require('../assets/email.png')}/>
<TextInput style={styles.inputs}
placeholder="Password"
secureTextEntry={true}
underlineColorAndroid='transparent'
onChangeText={(password) => this.setState({password})}/>
</View>
这是样式:
const styles = StyleSheet.create({
inputs:{
height:155,
marginLeft:7,
borderBottomColor: '#ffff',
},
inputContainer: {
borderBottomColor: '#F5FCFF',
// backgroundColor: '#FFFFFF',
borderRadius:50,
borderBottomWidth: 2,
width:350,
height:45,
marginBottom:180,
flexDirection: 'row',
alignItems:'center'
},
inputContainerx: {
borderBottomColor: '#F5FCFF',
// backgroundColor: '#FFFFFF',
borderRadius:50,
borderBottomWidth: 2,
width:350,
height:45,
flexDirection: 'row',
alignItems:'center',
},
inputIcon:{
width:30,
height:30,
marginLeft:15,
justifyContent: 'center'
},
});