gpt4 book ai didi

javascript - React Native Elements 行在 FormInput 组件下面

转载 作者:行者123 更新时间:2023-11-30 20:28:39 24 4
gpt4 key购买 nike

我正在使用 React Native Elements 中的 FormInput 元素,它似乎在每个 FormInput 组件下方生成一条线。一个比另一个更微弱。

enter image description here

表单如下所示

<View style={styles.container}>
<Image
style={styles.image}
source={app.imageBackground}
/>
<View style={{ alignItems: 'center' }}>
<Image
style={styles.logo}
source={app.logo}
/>
</View>

<View style={styles.cardWrapper}>
<View style={styles.card}>
<FormInput
inputStyle={styles.textInput}
placeholder='user@email.com'
autoCapitalize='none'
autoCorrect={false}
underlineColorAndroid='transparent'
placeholderTextColor='white'
onChangeText={this.onEmailChange.bind(this)}
/>
<FormInput
secureTextEntry={true}
autoCapitalize='none'
placeholder='password'
autoCorrect={false}
inputStyle={styles.textInput}
underlineColorAndroid='transparent'
placeholderTextColor = 'white'
onChangeText={this.onPasswordChange.bind(this)}
/>
<FormValidationMessage>{this.renderError()}</FormValidationMessage>
{this.renderButton()}

<Text style={{color:'white', textAlign:'center'}}>New to Foodspecials?<Text style={{fontWeight:'900'}} onPress={() => this.props.navigation.navigate('SignUp')}> Sign up</Text></Text>
</View>
</View>

</View>

这是我的风格

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
cardWrapper: {
padding: 20
},
card: {

},
logo: {
justifyContent: 'center',
},
image: {
backgroundColor: '#ccc',
flex: 1,
position: 'absolute',
width: '100%',
height: '100%',
justifyContent: 'center',
},
textInput: {
height: 50,
fontSize: 20,
borderRadius: 50,
backgroundColor: 'rgba(255, 255, 255, 0.3)',
color: 'white',
width: '100%',
paddingLeft: 20,
marginTop: 10,
marginBottom: 10
},
button: {
borderWidth: 2,
borderColor: 'white',
marginTop: 10,
marginBottom: 10
}
})

我尝试将 0 的 borderWidth 属性添加到 FormInput,但这似乎不起作用。

我还尝试将 borderColor 设置为透明,但也没有用。

我还注意到,如果我删除 FormValidationMessage 组件,两条线都会变得更加明显。

有解决办法吗?

最佳答案

我遇到了同样的问题,并通过添加 borderBottomWidth:0 解决了这个问题,如下所示:

<Input inputContainerStyle={{borderBottomWidth:0}} />

关于javascript - React Native Elements 行在 FormInput 组件下面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50602486/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com