react-native怎么和html一样,多张图片混在同一行?
How react-native does the same as html, multiple images are mixed in the same line?
html:
- 但是在 react-native 中,这是我的代码,边距不起作用:
(我不太会操作这个代码编辑器,放个图吧)
我的另一个尝试:
<View style={{flexDirection: 'row', flex: 1, flexWrap: 'wrap'}}>
<Text>12444444444444442222222222222222222222222222222</Text>
<Image source={{uri: url}} style={{width:20,height:20}} />
<Text>1244444444444444222222222222222222222222222222222222222222222222222222222222222222222</Text>
</View>
但是效果很差
这张黄色图片是你想要的吗?
You can use it in view
<Text> Your text
<View style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
marginLeft: 5,
marginRight: 5
}}>
<Image source={{uri: url}} style={{width: 20, height: 20,}}/>
</View>
Your text
</Text>
without View use space in same line
<Text>asdasdad
{space}<Image source={{uri: url}} style={{width: 20, height: 20,}}/>
{space}hasgdjhasd</Text>
html:
- 但是在 react-native 中,这是我的代码,边距不起作用:
我的另一个尝试:
<View style={{flexDirection: 'row', flex: 1, flexWrap: 'wrap'}}>
<Text>12444444444444442222222222222222222222222222222</Text>
<Image source={{uri: url}} style={{width:20,height:20}} />
<Text>1244444444444444222222222222222222222222222222222222222222222222222222222222222222222</Text>
</View>
但是效果很差
这张黄色图片是你想要的吗?
You can use it in view
<Text> Your text
<View style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
marginLeft: 5,
marginRight: 5
}}>
<Image source={{uri: url}} style={{width: 20, height: 20,}}/>
</View>
Your text
</Text>
without View use space in same line
<Text>asdasdad
{space}<Image source={{uri: url}} style={{width: 20, height: 20,}}/>
{space}hasgdjhasd</Text>