【发布时间】:2018-08-24 13:12:04
【问题描述】:
我正在使用 React Native Elements (1.0) 来显示我的 <ListItem />s。我想知道是否有办法让标题与添加字幕时保持在同一行?
这是我目前拥有的,这是错误的:
我想要的是与“Filterkaffee”和“Klein”对齐的“1x”,并有下面的字幕。
编辑
这里也是 ListItem 的代码:
<ListItem
title={item.name}
leftElement=<Text style={styles.amount}>{item.amount}x</Text>
rightTitle={`${item.price.label}`}
subtitle={`${
item.items.length > 0
? item.customChoiceItems.reduce((acc, customChoiceItem, index, arr) => {
acc += customChoiceItem.name;
acc += index < arr.length - 1 ? "\n" : "";
return acc;
}, "")
: null
}`}
onPress={() => {}}
/>
【问题讨论】:
-
你可以使用 flex-start
标签: react-native listitem react-native-flatlist