无论如何要在 <Text> 中嵌入图像?在反应原生 [英] Is there anyway to embed image in <Text> in react-native
本文介绍了无论如何要在 <Text> 中嵌入图像?在反应原生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可能想要实现富文本编辑或富文本视图.在html中我们可以使用inline image tag来实现,但是react-native Text只能在其中嵌套Text.
Someone may want to implement a richtext edit or richtext view. In html we can do it with inline image tag, but react-native Text can only nest Text in it.
推荐答案
这是一个可以保留样式的解决方法
Here's a workaround that'll preserve styles
<View style={{flexDirection:'row', flexWrap:'wrap'}}>
<Image
style={styles.img}
source={{uri: imageLink}} />
<Text>
{"sweet, this works"}
</Text>
</View>
这篇关于无论如何要在 <Text> 中嵌入图像?在反应原生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文