Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 是否仍要在<;中嵌入图像;文本>;以自然反应_React Native - Fatal编程技术网

React native 是否仍要在<;中嵌入图像;文本>;以自然反应

React native 是否仍要在<;中嵌入图像;文本>;以自然反应,react-native,React Native,有人可能想要实现richtext编辑或richtext视图。 在html中,我们可以使用内联图像标记来实现,但react-native文本只能在其中嵌套文本。这已经添加到0.16-rc中的react-native中。更新您的React本机版本,并查看以下示例: 这里有一个保留样式的解决方法 <View style={{flexDirection:'row', flexWrap:'wrap'}}> <Image style={styles.img}

有人可能想要实现richtext编辑或richtext视图。
在html中,我们可以使用内联图像标记来实现,但react-native文本只能在其中嵌套文本。

这已经添加到0.16-rc中的react-native中。更新您的React本机版本,并查看以下示例:


这里有一个保留样式的解决方法

<View style={{flexDirection:'row', flexWrap:'wrap'}}>
    <Image
        style={styles.img}
        source={{uri: imageLink}} />
    <Text>
        {"sweet, this works"}
    </Text>
</View>

{“好极了,这能行”}

谢谢。这就是我想要的。但我试过了,它现在只在ios上运行,而且这种风格似乎不起作用。在文本中指定图像的宽度和高度不起作用。我发现我可以将图像嵌套在文本中,但无法控制图像的边距以在图像和文本之间提供某种分隔。最终使用了@Ricky发布的flex解决方案。不适合多行文本