【发布时间】:2016-05-07 07:47:06
【问题描述】:
我有以下精简的渲染结果:
return (
<View style={{backgroundColor:'red'}}>
<TextInput value={'Hello'}/>
</View>
);
生成的 TextInput 在 iOS 中是不可见的,除非我指定高度,并且在其容器中使用 flexDirection:'row' 时,我还需要指定其宽度。
这只发生在 iOS 上,Android 似乎可以正常工作。
有没有办法在 iOS 中显示没有固定大小的 TextInput?
当前依赖项:
"dependencies": {
"react-native": "=0.18.1",
"react-native-orientation": "=1.12.2",
"react-native-vector-icons": "=1.1.0"
},
iOS:
安卓:
像这样改变渲染:
return (
<View style={{backgroundColor:'red'}}>
<Text>text</Text>
<TextInput value={'Hello'}/>
</View>
);
有以下结果:
iOS:
安卓:
【问题讨论】:
标签: ios react-native