【发布时间】:2017-05-09 17:44:34
【问题描述】:
我有一个视图包装了许多按钮,并且仍然通过 textinpt 持续创建更多按钮,下面的 clode,现在的结果,它向底部创建了新的 line 按钮,但是 textinpt 组件会空白,为什么?,任何人都知道怎么解决?
我的目标是自动挤压 textinpt 向下移动并让它显示整个 bottons。
const styles = {
interests:{
flexDirection: 'column',
justifyContent: "space-between",
paddingRight: 10,
paddingLeft: 10,
},
editSection: {
//flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff',
},
editIcon: {
flex: 0.05,
paddingTop: 25
},
input: {
flex: 0.95
},
popularTag:{
flexWrap: 'wrap',
flexDirection: 'row-reverse',
justifyContent: 'flex-end',
paddingTop: 10,
}
}
return(
<View style = { styles.interests }>
<View style = { styles.popularTag }>
{ this.renderShowLists() }
</View>
<View style = { styles.editSection }>
<View style = { styles.input }>
<TextInput
placeholder = "Type your Interests"
onSubmitEditing = { this.onKeyPress }
onChangeText = { (text) => this.setState({ text }) }
value = { this.state.text }
/>
</View>
<View style = { styles.editIcon }>
<Icon name = "border-color" color = "#000000" size = { 20 } />
</View>
</View>
</View>
)
实际上是三行,第二行由textinput分块
【问题讨论】:
标签: javascript reactjs react-native