如何实现像微信聊天下拉加载呢?

小程序 文章 2021-03-24 10:22 448 0 全屏看文

AI助手支持GPT4.0

如何实现像微信聊天下拉加载呢?How to implement drop-down loading like WeChat chat?

如何实现像微信聊天下拉加载呢?

我在下拉加载的时候 拼接数据 每次都直接渲染 然后就跑到新进来数据的第一条


有办法做成像微信聊天加载历史消息的时候 下拉 -> 加载符号 -> 新数据拼接(重点滚轮不滑动)


用过scroll-view 但是一直做不到想要的效果 自己想的逻辑是 wxml 分成两块 预先加载0-9条数据 在二次加载10-19条数据隐藏


但是后面就没想法了 有类似的代码段可以给我参考一下吗 感谢各位大佬!!!

When I pull down and load, I directly render the stitched data every time, and then I run to the first one of the new data. When I have a way to do imaging wechat chat and load historical messages, I pull down, load symbols, and new data stitching (the key wheel doesn't slide). I have used scroll view, but I can't achieve the desired effect. My logic is that wxml is divided into two parts Pre loading 0-9 data, secondary loading 10-19 data hiding, but behind no idea, there are similar code can give me a reference? Thank you guys!!!

回答:

Wkiwi:

https://blog.bemcss.com/index/article/show/id/110.html


我之前用uni实现过,你可以改成原生的试试

wang li:

上拉加载就有,这个还真不知道,同求

Made in.内江:

我们也在做这一块。用小程序发现会有抖动的问题。

-EOF-

AI助手支持GPT4.0