我需要关于react-native图片并排显示的帮助。我无法以正确的方式完成它。 我想要这些图片并排显示,分为两列和2行。 以下是我的代码
<View style={{ flexDirection: "row" }}>
<Text>Sample</Text>
<TouchableOpacity
style={{ alignItems: "center" }}
onPress={() =>
Linking.openURL(
"#"
)
}
>
<Image
source={transport}
style={{ width: 150, height: 120, padding: 50 }}
/>
</TouchableOpacity>
<Text>Sample</Text>
<TouchableOpacity
style={{ alignItems: "center" }}
onPress={() =>
Linking.openURL(
"#"
)
}
>
<Image
source={entertainment}
style={{ width: 150, height: 120, padding: 50 }}
/>
</TouchableOpacity>
<Text>Sample</Text>
<TouchableOpacity
style={{ alignItems: "center" }}
onPress={() =>
Linking.openURL(
"#"
)
}
>
<Image
source={doorkay}
style={{ width: 150, height: 120, padding: 50 }}
/>
</TouchableOpacity>
<Text>Sample</Text>
<TouchableOpacity
style={{ alignItems: "center" }}
onPress={() =>
Linking.openURL(
"#"
)
}
>
<Image
source={blood}
style={{ width: 150, height: 120, padding: 50 }}
/>
</TouchableOpacity>
</View>