在一个视图中显示来自 url 和文本的混合图像 [英] Show mix image from url and text in one view react-native

查看:62
本文介绍了在一个视图中显示来自 url 和文本的混合图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了问题,不知道如何解决.我有一条这样的消息:

这是我的信息:tongue_out::wink:dsdangrydsangryhoanghamobile.comdsd:wink:这是表情符号和更多文字....

它会像下面的图片一样显示 :wink: , :tongue_out: 其他表情符号是来自链接的图片:

解决方案

  1. 将消息切片到 TEMP 数组,像这样 ['This is my message',':tongue_out:',':wink:']
  2. 使用TEMP,检测图像元素:abc:,然后可以循环显示TextImage> 内联,例如 inline-image解决方法
  3. 表情符号是远程图像,因此您必须将其缓存以快速显示.您可以使用 FastImage

I have a problem and don't know how to fix it. I have a message like this:

This is my message:tongue_out::wink:dsdangrydsangryhoanghamobile.comdsd:wink:this is emoji and more text....

It's will be show like an image below with :wink: , :tongue_out: and the others emoji is an image from link: https://filev4.subiz.com/wink.png. All is an string and now i have to parse emoji from url and text to display. I don't know how many text and emoji contain, and how to display all in one view in react-native. Now, i really need some help, thank very much.

解决方案

  1. Slice the message to TEMP array, like this ['This is my message',':tongue_out:',':wink:']
  2. With TEMP, detect element :abc: for image, then you can loop and display Text and Image inline, like inline-image or workaround
  3. The Emoji is the remote image so you have to cache it for fast display. You can use FastImage

这篇关于在一个视图中显示来自 url 和文本的混合图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆