Skip to content
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

RecyclerView使用时有性能问题 #25

Open
dujp opened this issue Apr 26, 2020 · 1 comment
Open

RecyclerView使用时有性能问题 #25

dujp opened this issue Apr 26, 2020 · 1 comment

Comments

@dujp
Copy link

dujp commented Apr 26, 2020

  1. 我作为消息列表, 在recyclerView里面使用的时候, 内存会上涨非常厉害, 而且释放很慢, 由于一直要刷drawable, 所以CPU的使用情况也很高.
  2. 没有办法在item里面动态去添加gif, 必须要先把gif初始化出来以后才能使用
@sunhapper
Copy link
Owner

第一种情况是不是每显示一个Drawable就创建一个?没做缓存?demo中有在RecyclerView中的用法,相同的Drawable不会重复创建
在Item中创建Drawable应该也是可以的,但是这种情况感觉性能问题会比较严重,把Drawable创建出来和数据绑定在一起,应该会比根据数据动态创建Drawable更节约资源一些
如果可以的话能否贴下使用的代码,我来看看是哪有问题

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

2 participants