react-native: border top/left/bottom/right width not working
I have this in my render method:
return View(
{ style: { flex: 1 } },
TouchableWithoutFeedback(
{ onPress: this.handlePress },
View({
style: {
flex: 0,
backgroundColor: 'gray',
height: 50,
alignItems: 'center',
justifyContent: 'center',
borderWidth: 1,
borderColor: 'white'
},
}, Text({ style: { color: 'white' }}, "^"))
),
TouchableWithoutFeedback(
{ onPress: this.handlePress },
View({
style: {
flex: 0,
backgroundColor: 'gray',
height: 50,
alignItems: 'center',
justifyContent: 'center'
},
}, Text({ style: { color: 'white' }}, "v"))
)
)
It renders this:
But if I change the borderWidth
in the first component to borderBottomWidth
or any of the other top/left/bottom/right methods, there is no border. There should be a white border on one side of the component:
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 49 (12 by maintainers)
Commits related to this issue
- Merge pull request #29 from whatasunnyday/master Fix broken link to flux-todomvc. — committed to harrykiselev/react-native by fisherwebdev 10 years ago
- JSONKit usage here may cause serious crash hard to debug(I found the crash on simulator, on device I got nothing but app freezed)! My app has an old version of JSONKit which is still using MRC. I thin... — committed to dustturtle/react-native by dustturtle 8 years ago
👍 I need this for
<TextInput />
There is no pain guys - all will work with
<View>
wrapping any<Text>, <TextInput>, <Touchable...>
👍 for
TextInput
😃<View>
wrapping is painful. It makes styling a pain. Especially with error states. 1 field = 4 independent styles.+1 for
Text
Argh, nevermind, Apparently it is not activated for
<Text />
nodes and I’m now wrapping a<View />
around them.It’s not yet working for me (on 0.4.0)
+1 for
Textinput
A workaround is to wrap your
TextInput
orText
in aView
and apply the borders on theView
.Guys, make sure that you’re voting it up in here: https://productpains.com/post/react-native/add-borderwidth-left-right-top-bottom-to-textinput-/ instead of +1’ing.
Should be working now