Skip to content

listview嵌套回复内容时,回复数量多的时候会很卡顿 ,如何提高textview渲染性能? 请各位大神赐教 #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zhy1905 opened this issue Feb 2, 2016 · 10 comments

Comments

@zhy1905
Copy link

zhy1905 commented Feb 2, 2016

No description provided.

@zhy1905 zhy1905 changed the title 微信朋友圈 qq空间的回复列表是如何显示的,自定义viewgroup和嵌套listview都会很卡顿,当回复数多的时候,但是qq空间和朋友圈滑动起来却非常流畅,请各位大神赐教 微信朋友圈 qq空间的回复列表是如何实现的,自定义viewgroup和嵌套listview都会很卡顿,当回复数多的时候,但是qq空间和朋友圈滑动起来却非常流畅,请各位大神赐教 Feb 2, 2016
@yankai-victor
Copy link

#80

@tanranran
Copy link

@zhy1905
Copy link
Author

zhy1905 commented Feb 3, 2016

@tanranran 这个回复列表也是通过item嵌套listview实现的,但是还是评论数多的时候滑动起来还是会很卡顿

@xingty
Copy link

xingty commented Feb 26, 2016

在公司的项目写过一个类似的实现,用的是很取巧的方式。思路可以看https://wiyi.org/avoid-nest-list-view.html。

内容作为group,评论作为child就行了,避免了嵌套的问题,不会造成卡顿。

@razerdp
Copy link

razerdp commented Feb 26, 2016

这个是我的朋友圈一步一步实现的项目,目前一直在维护,刚撸完一个初学的服务器,相关文章都在readme中有写到,跳到简书文集看就可以了。

我的评论列表用的是linearlayout+textview扩展实现
在滑动的时候判断回复数量和linearlayout,然后动态的add/remove差额

比如当前item有5个view,但复用后新下发的评论有8个,那我们就New出3个add进去,然后再设置。
下一步,我的打算是维护一个池,那我们补充差额的时候就不用new了,直接就从池拿。

同时欢迎PR -V-

https://github.com/razerdp/FriendCircle

@zhy1905
Copy link
Author

zhy1905 commented Feb 26, 2016

@xingty 链接失效了

@xingty
Copy link

xingty commented Feb 26, 2016

@gdgm123
github把句号也加上去了,晕。https://wiyi.org/avoid-nest-list-view.html

@zhy1905
Copy link
Author

zhy1905 commented Feb 26, 2016

@razerdp 我的是自定义viewgroup+textview+子view的复用,,建议不要remove view 而是复用的时候多余设置为GONE,这样避免了remove刷新卡顿,复用优化不是很大,虽然主要卡顿还是在于每个评论的textview的渲染,测量 定位问题

@zhy1905
Copy link
Author

zhy1905 commented Feb 26, 2016

@xingty 我找个时间试试你的思路,非常感谢

@HomHomLin
Copy link

一个ViewGroup,往里面加子View

@zhy1905 zhy1905 closed this as completed Feb 29, 2016
@zhy1905 zhy1905 reopened this Feb 29, 2016
@zhy1905 zhy1905 changed the title 微信朋友圈 qq空间的回复列表是如何实现的,自定义viewgroup和嵌套listview都会很卡顿,当回复数多的时候,但是qq空间和朋友圈滑动起来却非常流畅,请各位大神赐教 listview嵌套回复内容时,回复数量多的时候会很卡顿 ,如何提高textview渲染性能? 请各位大神赐教 Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants