代码之家  ›  专栏  ›  技术社区  ›  Hoàng VÅ© Anh

在一个视图中显示来自URL和文本的混合图像react native

  •  4
  • Hoàng VÅ© Anh  · 技术社区  · 8 年前

    我有个问题,不知道怎么解决。我有这样的信息:

    这是我的信息:tough_out::wink:dsdangrydsangryhoanghamobile.comdsd:wink:this is emoji and more text…。

    它将像下面的图片一样显示 :眨眼:,:舌头出: 其他的emoji是来自link的图像: https://filev4.subiz.com/wink.png . 所有这些都是一个字符串,现在我必须从URL和文本中解析emoji来显示。我不知道有多少文本和emoji包含,以及如何在react native的一个视图中显示所有内容。现在,我真的需要帮助,非常感谢。

    enter image description here

    1 回复  |  直到 8 年前
        1
  •  1
  •   tuledev    8 年前
    1. 将消息切片到 临时雇员 数组,像这样 ['This is my message',':tongue_out:',':wink:']
    2. 用 临时雇员 ,检测元素 :abc: 对于图像,则可以循环并显示 Text 和 Image 内联,类似 inline-image 或 workaround
    3. emoji是远程图像,因此您必须缓存它以便快速显示。你可以用 FastImage
    推荐文章