I'm using the FormInput element from React Native Elements, which seems to produce a line underneath each FormInput component. One is more faint than the other.
Form looks as follows
<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='[email protected]'
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>
Here are my styles
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
}
})
I've tried to add a borderWidth property of 0 to the FormInput but this doesn't seem to work.
I've also tried to set a borderColor to transparent which didn't work either.
I've also noticed, if I remove the FormValidationMessage component, both line become more apparent.
Is there a workaround for this?
I was facing the same issue and fixed it by adding borderBottomWidth:0 as belows:
<Input inputContainerStyle={{borderBottomWidth:0}} />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With