Here's my style for the input:
searchBarInput: {
flex: 1,
fontSize: 20,
fontWeight: 'bold',
color: 'white',
height: 50,
padding: 0,
backgroundColor: 'transparent',
borderColor: '#000000',
borderWidth: 50,
borderStyle: 'solid',
}
If I change the border width, the size of the input changes, but still there's no visible border.
I am using react-native 0.15.0 with an android device.
Step-1 : Create a new React Native project. Step-2 : Add Platform, StyleSheet, Text, View, TextInput Component in import block. property of CSS Stylesheet in TextInput Component. This CSS property will change the TextInput field border to rounded corner.
TextInput has by default a border at the bottom of its view. This border has its padding set by the background image provided by the system, and it cannot be changed.
Just set the underlineColorAndroid prop of TextInput to transparent or the color which is the background color of the input field.
Does this answer your question : https://github.com/facebook/react-native/blob/master/docs/KnownIssues.md#text-input-border
It seems it is a known bug from react-native...
You can try and wrap it in a view component and set the border you want on the view component.
As per react native doc, you need to set below in text input properties:
multiline={true}
This is now fixed on Android via underlineColorAndroid="transparent"
source: https://facebook.github.io/react-native/releases/0.26/docs/known-issues.html#text-input-border (archive)
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