我是对原生布局做出反应的新手。
我想把内联的句子用图像分隔,其中句子是内联的,图像就像逗号......
我做了一个包含数组的 json 文件,我在它上面创建了 map 函数,并在其中放置了文本标签和图像标签。
但是输出与我的设计不符。
import React, { Component } from 'react';
import image1 from './assets/image.jpg'
import {
StyleSheet,
ScrollView,
View,
Text,
Image,
} from 'react-native';
import Monday1 from "./data/monday1";
class App extends Component {
constructor(props) {
super(props);
}
render() {
return (
<ScrollView>
<View style={{ marginRight: 20, marginLeft: 20, marginTop: 20 }}>
<View style={{ flex: 1, flexDirection: 'row', flexWrap: 'wrap' }}>
{Monday1.map((Monday1Text, key) =>
<View style={styles.border2}>
<View style={styles.border}>
<Text key={key} style={styles.text}>
{Monday1Text}
</Text>
</View>
<Image style={{ …Run Code Online (Sandbox Code Playgroud)