Monday, June 3, 2024
144
rated 0 times [  151] [ 7]  / answers: 1 / hits: 38051  / 7 Years ago, wed, june 21, 2017, 12:00:00

I have followed styles:



const styles = StyleSheet.create({
title: {
textDecorationLine: 'underline',
textDecorationStyle: 'solid',
textDecorationColor: '#000'
}
});


and it creates the underline for my content into some Text component. But it seems that this underline is too close to the text decorated with it.



Can I increase this distance in some how?



Thank you for helping!


More From » react-native

 Answers
3

  1. Wrap your Text in a View that has a style containing borderBottomWidth: 1 or whatever you want the thickness to be.


  2. Give your Text a lineHeight to adjust the spacing between the border and the content. If you have multiple lines of text, then using paddingBottom would also work.




Simple as that really. Bear in mind the View border will stretch to include any padding on the View itself.


[#57356] Monday, June 19, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brandensebastiand

Total Points: 323
Total Questions: 115
Total Answers: 106

Location: China
Member since Mon, Aug 22, 2022
2 Years ago
;