Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Adding border only to the one side of the component in React Native (iOS)

$
0
0

I am facing something weird issue with React-Native's <Text/> component in iOS.

I wanted to apply borderBottomWidth style into <Text/> component but it did NOT work. However, the borderWidth option worked.

  • Worked<Text style={{borderWidth:1}}> React Native </Text>

  • NOT Worked<Text style={{borderBottomWidth:1}}> React Native </Text>


Is there any way to only apply bottom level border into the <Text/> component?

Thank you!


Note:

I am aware of following mentioned approaches in order to achieve this but in my case, I required to apply the style only to the <Text/> component.

  1. We can try wrapping <View/> to the <Text/> and apply borderBottomWidth style to the <View/>. (borderBottomWidth works fine with <View/>)
  2. Adding such <View/> just below to the <Text/> component which can look like a line.

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>