image_urlI有一个React原生应用程序,文本分成两行。 我希望它呈现在一个单行。 任何帮助。 附加屏幕的代码和截图
这一行
<View>
<Text style={styles.product_name}>
{item.product_name}
</Text>
</View
null
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
backgroundColor: colors.theme_bg_two,
},
header: {
backgroundColor: colors.theme_bg_three,
},
product_name: {
alignSelf: "center",
fontSize: 15,
fontWeight: "bold",
color: colors.theme_fg_two,
},
});
null
您可以将“flex-wrap”属性添加到具有值“nowrap”的“容器”中。
它将强制flexbox将项目保留在一行上。
有用链接:https://css-tricks.com/snippets/css/a-guide-to-flexbox/