Comments (4)
应该是和ImageShowPickerView中设置LayoutParams的代码有关,就是计算RecyclerView的LayoutParams,解除注释,可以运行,但是不显示任何内容
from imageshowpicker.
报告日志如下:
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.
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.
@JamesLiAndroid @603751448 目前最快解决方案就是使用25.3.1版本的recyclerview,其他引用尽量也使用这个版本即可解决这个问题
from imageshowpicker.
Related Issues (14)
- 点击图片不能查看大图 HOT 2
- 使用过程中跟可扩展的。
- 放在scrollview或者recyclerview中,图片不显示 HOT 3
- 当使用compileSdkVersion 27时程序崩溃 HOT 1
- 是不是存在版本不兼容问题
- 有一个问题。 HOT 10
- 图片不显示 HOT 4
- 上下滑动的时候,会有卡顿不流畅 HOT 1
- 可以支持选择时拍照吗 HOT 1
- 2个问题1个建议 HOT 1
- “有点问题” HOT 5
- 关于数据更新的问题 HOT 3
- 选择图片时,如果图片过大,就会出现OOM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imageshowpicker.