【发布时间】:2021-07-14 11:12:51
【问题描述】:
我想制作一个多行文本区域。因此,如果我将字段的高度设置为 100,那么占位符和输入文本将居中,而不是在顶部。
我希望文本从顶部开始。
<View style={{flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', marginTop: 50}}>
<AntDesign name="infocirlceo" size={24} style={{backgroundColor: '#fff', padding: 10, borderRadius: 100, marginRight: 12}} color="#555" />
<TextInput
style={{padding: 10, height: 100, backgroundColor: '#fff', borderWidth: 1, width: 250, borderRadius: 8, borderColor: '#eee'}}
placeholder="Proudktbeschreibung eingeben"
multiline
numberOfLines={1}
/>
</View>
【问题讨论】:
-
您尝试过哪些更改,效果如何?
-
试试
textAlignVertical: 'top'的风格 -
“Produktbeschreibung”只是提示你有错别字
标签: reactjs react-native expo