Adding Border Only To The One Side Of The Component In React Native (iOS)


Answer :

Even though borderBottom doesn't work on the Text component, it did work for me on the TextInput component, just set editable to false and set the value to your desired text as so...

<TextInput     style={styles.textInput}     editable={false}     value={'My Text'}/>  const styles = StyleSheet.create({     textInput: {         borderBottomColor: 'black',         borderBottomWidth: 1,     } }); 

This isn't currently possible. See the following RN issue: https://github.com/facebook/react-native/issues/29 and this ticket on Product Pains: https://productpains.com/post/react-native/add-borderwidth-left-right-top-bottom-to-textinput-/


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools