Giter VIP home page Giter VIP logo

Comments (8)

gyh avatar gyh commented on June 2, 2024 1

ListViewTestActivity 中将listView.setAdapter(test01(data)); 替换为listView.setAdapter(test02(data));,发现在 createItem 中出错,type为null

from commonadapter.

kaleai avatar kaleai commented on June 2, 2024

你可以测试一下onBindViewHolder调用前都会自动调用一次,getItemType方法。这个和listview的getItemType不同。
rcv的流程是:
在onCreateViewHolder前调用getItemType方法来得到item的类型,将类型传入onCreateViewHolder(ViewGroup parent, int viewType)中

在onBindViewHolder 前会调用一次getItemType来得到类型。

测试结果:
qq 20160225112431

qq 20160225111958

from commonadapter.

kaleai avatar kaleai commented on June 2, 2024

如果觉得有问题也可以测试一下看看,谢谢你的指出。我可以去排查下别的地方会不会有这个问题

from commonadapter.

c1024 avatar c1024 commented on June 2, 2024

截图里面的那个方法我这边源码看不到,我的RecycleView版本也是23.1.1。我这边bindViewHolder是在getViewForPosition里面调用。奇怪,都是同一版本。
截图如下:
Image of Yaktocat

from commonadapter.

kaleai avatar kaleai commented on June 2, 2024

这个你可以在代码里面测试一下吧,看看最终的结果。这样靠谱一点。

from commonadapter.

kaleai avatar kaleai commented on June 2, 2024

已经找到了这个问题,正在解决@gyh

from commonadapter.

kaleai avatar kaleai commented on June 2, 2024

@gyh问题是我在CommonAdapter构造方法中,忘记传了一个item的类型数目,你写上3就行。我稍后会改下demo。

new CommonAdapter(data, 3)

这个是demo的问题,不是库的问题。所以没什么影响,同时谢谢你的反馈。我以后会强制传递一个count。

如果解决了你的问题,你可以close掉这个问题

from commonadapter.

kaleai avatar kaleai commented on June 2, 2024

在最新的demo中已经解决了这个问题,请验证

from commonadapter.

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.