TextInput underline color for ios in react-native

Viewed 15904

i am doing mobile applications in react-native for android and ios. In my project i am using TextInput Component(ios). This component appear without underline. How to use TextInput with underline color in ios.

code sample -

<TextInput
 ref={'cardbatch1'}                 
 keyboardType = 'numeric'
 placeholder = 'Batch Number'
 autoCapitalize = 'none'                                                    
/>
2 Answers

Try this in styles.. see the difference in output

const styles = StyleSheet.create({

    inputBox: {
        .....
        borderBottomWidth: 1,
        borderBottomColor: 'gray',
        ....
    }
});

Finally add the style in textInput

<TextInput
 ...             
 keyboardType = 'numeric'
 placeholder = 'Batch Number'
 autoCapitalize = 'none'
 style={styles.inputBox}
.....                                                    
/>
Related