Giter Site home page Giter Site logo

Comments (3)

Kelin-Hong avatar Kelin-Hong commented on September 6, 2024 3

你好,控件是有View的复用,我特意又打了断点测试了一下,没办法做到二维的完全复用,但是并不是每次都执行onCreateViewHolder 方法,你可以简单的测试下,打开Demo,向右滑到底后,再向左滑onCreateViewHolder 就不执行了(上下滑同理)。或者你可以在 onCreateViewHolder 打log,然后看看滑动新增可见的View 的个数 是否==onCreateViewHolder执行的个数来判断有无View复用。或者看下源码,是一个二维的Recycler 叠加的控件,实现原理有视图缓存的,只是不能很完全每个View都做到复用。

from scrollablepanel.

z3896823 avatar z3896823 commented on September 6, 2024

非常感谢你的回复。

其实我们俩说的是同一回事,可能我之前的表达有误。我的意思是能不能提供一个类似于convertView的机制,将滑出屏幕的视图进行回收,让即将展现的视图使用被回收的视图,这样只需要调用(一屏的view个数多一点)次onCreateViewHolder方法,或许可以提高性能,解决卡顿现象。

ps:非常喜欢这个库,使用简单方便,自定义程度高,只是横滑的卡顿着实让体验大打折扣。我最近也有抽空学习源码,希望能贡献自己的一份力量。再次感谢分享。

from scrollablepanel.

z3896823 avatar z3896823 commented on September 6, 2024

搜索了很多资料,依然没搞清楚RecyclerView的回收机制,索性今天抽空用ListView写了个类似的库,由于使用的是原生ListView,所以保留了ListView的特性。因为我感觉ListView的回收机制好控制一些,实现了一样的效果,差不多解决了卡顿问题吧。。如果可以的话请指导一下,谢谢!

https://github.com/z3896823/PanelList

from scrollablepanel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.