在一个视图中显示来自 url 和文本的混合图像 [英] Show mix image from url and text in one view react-native
问题描述
我遇到了问题,不知道如何解决.我有一条这样的消息:
这是我的信息:tongue_out::wink:dsdangrydsangryhoanghamobile.comdsd:wink:这是表情符号和更多文字....
它会像下面的图片一样显示 :wink: , :tongue_out: 其他表情符号是来自链接的图片:
- 将消息切片到 TEMP 数组,像这样
['This is my message',':tongue_out:',':wink:']
- 使用TEMP,检测图像元素
:abc:
,然后可以循环显示Text
和Image
> 内联,例如 inline-image 或 解决方法 - 表情符号是远程图像,因此您必须将其缓存以快速显示.您可以使用 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.
- Slice the message to TEMP array, like this
['This is my message',':tongue_out:',':wink:']
- With TEMP, detect element
:abc:
for image, then you can loop and displayText
andImage
inline, like inline-image or workaround - The Emoji is the remote image so you have to cache it for fast display. You can use FastImage
这篇关于在一个视图中显示来自 url 和文本的混合图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!