Giter Site home page Giter Site logo

Comments (9)

CymChad avatar CymChad commented on May 1, 2024

你用的是那种adapter?

from baserecyclerviewadapterhelper.

CymChad avatar CymChad commented on May 1, 2024

是最新的版本吗?

from baserecyclerviewadapterhelper.

wuyongx avatar wuyongx commented on May 1, 2024

嗯。最新版。线性布局 header。

from baserecyclerviewadapterhelper.

CymChad avatar CymChad commented on May 1, 2024

是多布局的吗?

from baserecyclerviewadapterhelper.

CymChad avatar CymChad commented on May 1, 2024

还有就是你最好把crash的所有日志贴出来看看

from baserecyclerviewadapterhelper.

wuyongx avatar wuyongx commented on May 1, 2024

单一布局的

 private void setupRecyclerView(RecyclerView recyclerView) {
    Context context = recyclerView.getContext();
    recyclerView.hasFixedSize();
    recyclerView.setLayoutManager(new LinearLayoutManager(context));

    adapter =
        new BaseQuickAdapter<CreditClientInfo>(context, R.layout.client_card_progress_item, null) {
          @Override protected void convert(BaseViewHolder helper, CreditClientInfo info) {
            helper.setText(R.id.tv_in_date, info.ACCEPT_DATE);
            helper.setText(R.id.tv_receive_date, info.RECEIVE_DATE_TIME);
            helper.setText(R.id.tv_client_name, info.CLIENT_NAME);
            helper.setText(R.id.tv_card_status, info.APPLICATION_STATUS);
          }
        };
    //item 进入动画
    adapter.openLoadAnimation(BaseQuickAdapter.SLIDEIN_BOTTOM);
    recyclerView.setAdapter(adapter);
    //加载更多监听
    adapter.setOnLoadMoreListener(this);
    adapter.openLoadMore(PAGE_SIZE, true);
    //item 点击监听
    adapter.setOnRecyclerViewItemClickListener(this);
    adapter.setOnRecyclerViewItemChildClickListener(this);
    //添加头部
    headerView.setVisibility(View.VISIBLE);
    adapter.addHeaderView(headerView);
    //调用重新layout
    recyclerView.setAdapter(adapter);
  }

from baserecyclerviewadapterhelper.

CymChad avatar CymChad commented on May 1, 2024

把完整的crash贴出来。

from baserecyclerviewadapterhelper.

wuyongx avatar wuyongx commented on May 1, 2024

谢谢。回复真快。

java.lang.IndexOutOfBoundsException
Inconsistency detected. Invalid item position 21(offset:21).state:22
android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4659)
android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617)
android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994)
android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1390)
android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353)
android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1180)
android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1031)
android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4061)
android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
android.view.Choreographer.doCallbacks(Choreographer.java:670)
android.view.Choreographer.doFrame(Choreographer.java:603)
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
android.os.Handler.handleCallback(Handler.java:739)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5466)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)

from baserecyclerviewadapterhelper.

CymChad avatar CymChad commented on May 1, 2024

这是RecyclerView的bug 具体可查看 #16

from baserecyclerviewadapterhelper.

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.