Code Monkey home page Code Monkey logo

Comments (4)

JamesLiAndroid avatar JamesLiAndroid commented on August 15, 2024

应该是和ImageShowPickerView中设置LayoutParams的代码有关,就是计算RecyclerView的LayoutParams,解除注释,可以运行,但是不显示任何内容

from imageshowpicker.

603751448 avatar 603751448 commented on August 15, 2024

报告日志如下:
11-18 11:20:10.508 24792 24792 E AndroidRuntime:致命异常:主
11-18 11:20:10.508 24792 24792 E AndroidRuntime:进程:com.shrj.firecontrol,PID:24792
11-18 11: 20:10.508 24792 24792 E AndroidRuntime:java.lang.ClassCastException:android.widget.FrameLayout $ LayoutParams无法强制转换为android.support.v7.widget.RecyclerView $ LayoutParams
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.support.v7.widget.RecyclerView.getDecoratedBoundsWithMarginsInt(RecyclerView.java:4886)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.support.v7.widget.RecyclerView $ LayoutManager.getDecoratedBoundsWithMargins(RecyclerView.java: 9373)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.support.v7.widget.RecyclerView $ LayoutManager.setMeasuredDimensionFromChildren(RecyclerView.java:7531)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android。 support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3339)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.View.measure(View.java:19140)
11-18 11:20 :10.508 24792 24792 E AndroidRuntime:at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6113)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.view.View.measure(View.java:19140)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6113)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.widget.LinearLayout.measureChildBeforeLayout( LinearLayout.java:1723)11-18
11:20:10.508 24792 24792 E AndroidRuntime:at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android。 widget.LinearLayout.onMeasure(LinearLayout.java:648)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.View.measure(View.java:19140)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6113)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.support.v7.widget。 ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.View.measure(View.java:19140)
11-18 11:20:10.508 24792 24792 E AndroidRuntime :在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6113)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
11-18 11:20 :10.508 24792 24792 E AndroidRuntime:在android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.View.measure( View.java:19140)11-18
11:20:10508 24792 24792 E AndroidRuntime:at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6113)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android。 widget.FrameLayout.onMeasure(FrameLayout.java:223)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.View.measure(View.java:19140)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6113)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.widget.LinearLayout.measureVertical( LinearLayout.java:788)11-18
11:20:10.508 24792 24792 E AndroidRuntime:at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android。 view.View.measure(View.java:19140)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6113)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at com.android.internal.policy.PhoneWindow $ DecorView.onMeasure(PhoneWindow.java:2690)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android。 view.View.measure(View.java:19140)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2476)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1440)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1694)
11-18 11 :20:10.508 24792 24792 E AndroidRuntime:在android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1321)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:在android.view.ViewRootImpl $ TraversalRunnable.run(ViewRootImpl.java:6703)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.Choreographer $ CallbackRecord.run(Choreographer.java:894)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.Choreographer.doCallbacks(Choreographer.java:696)
11-18 11:20:10.508 24792 24792 E AndroidRuntime :at android.view.Choreographer.doFrame(Choreographer.java:631)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.view.Choreographer $ FrameDisplayEventReceiver.run(Choreographer.java:880)
11-18 11 :20:10.508 24792 24792 E AndroidRuntime:在android.os.Handler.handleCallback(Handler.java:815)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.os.Handler.dispatchMessage(Handler.java:104)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at android.os.Looper.loop( Looper.java:207)11-18
11:20:10508 24792 24792 E AndroidRuntime:在android.app.ActivityThread.main(ActivityThread.java:5692)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at java。 lang.reflect.Method.invoke(Native Method)
11-18 11:20:10.508 24792 24792 E AndroidRuntime:at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:891)
11-18 11: 20:10.508 24792 24792 E AndroidRuntime:at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:752)

布局和示例一样的,我怀疑是适配器的问题,正在看代码


你好,以上的最终问题你解决了没有,我目前也遇到了同样的问题。希望可以交流一下

from imageshowpicker.

603751448 avatar 603751448 commented on August 15, 2024

java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.support.v7.widget.RecyclerView$LayoutParams
at android.support.v7.widget.RecyclerView.getDecoratedBoundsWithMarginsInt(RecyclerView.java:4886)
at android.support.v7.widget.RecyclerView$LayoutManager.getDecoratedBoundsWithMargins(RecyclerView.java:9373)
at android.support.v7.widget.RecyclerView$LayoutManager.setMeasuredDimensionFromChildren(RecyclerView.java:7531)

from imageshowpicker.

yaozs avatar yaozs commented on August 15, 2024

@JamesLiAndroid @603751448 目前最快解决方案就是使用25.3.1版本的recyclerview,其他引用尽量也使用这个版本即可解决这个问题

from imageshowpicker.

Related Issues (14)

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.