I'm learning react-native,when I trying to use TextInput component in a flex layout, it disappear .
index.android.js
//....
render(){
return (
<View style={ {flex:1,flexDirection:'row'}}>
<TextInput placeholder="test"/>
</View>
)
}
//....
I was very confused.
I tried to set TextInput's height , but it doesn't work. And I finally success to set width or {flex:1} to TextInput. I think, when the parant container been set {flexDirection:"row"}, TextInput's width is 0, so I can't see it. By default,the parent container's flex direction is 'column',TextInput Element adjust itself's {flex:1} to fill the parent container.
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