【发布时间】:2022-08-18 22:45:24
【问题描述】:
在这里,我想要 test1 和 test2 之间的空间。
import React from \"react\";
import { StyleSheet, View } from \"react-native\";
function App() {
const data = [\"test1\", \"test2\", \"test3\"];
return (
<View style={styles.app}>
{data.map((text) => (
<span style={styles.span}>{text}</span>
))}
</View>
);
}
const styles = StyleSheet.create({
app: {
marginTop: 30,
position: \"absolute\",
backgroundColor: \"yellow\",
left: \"8px\",
widht: \"auto\",
flexDirection: \"row\",
alignItems: \"center\",
justifyContent: \"space-between\"
},
span: {
gap: 20
}
});
export default App;
但目前它看起来像这样
https://codesandbox.io/s/blissful-sea-tlbjso?file=/src/App.js 我怎样才能通过 css 实现这一点?
更新 - - - - - - - - - - - - - - - - - - - - - - - - - -----
标签: javascript css reactjs react-native sass