java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.
来源:互联网 发布:淘宝排名前10店铺大全 编辑:程序博客网 时间:2024/05/17 23:26
报错原因:
cover_iv.setLayoutParams(new RelativeLayout.LayoutParams(display.getWidth(),(int) (0.6 * display.getWidth())));
解决办法:
cover_iv.setLayoutParams(new LineLayout.LayoutParams(display.getWidth(),(int) (0.6 * display.getWidth())));
小结:
遇到问题时,解决思路有哪些,强化下,第一理清问题环境和背景,如查看如上错误提示,马上就可以定位问题,快速解决。第二、三、四,
0 0
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.L
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.R
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.view.ViewGroup$MarginLayoutParams
- 异常:java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.view.
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutPara
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widg
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widg
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.....
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.wid
- java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.wid
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widg
- java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.wid
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.app.ActionBar$LayoutParams cannot be cast to android.widget.Ab
- 开发问题及解决 java.lang.ClassCastException:android.widget.LinearLayout$LayoutParams
- Java垃圾回收机制
- Codeforces 85D Sum of Medians(线段树)
- TcpClient tcpClient
- [LeetCode] Candy
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.
- vim 简单配置
- Android事件处理
- 如何将系统的data目录迁移到web以外目录
- Google 在2014年10月15日发布Nexus 6, Nexus 9 和Nexus Player.
- 网站搭建从零开始(二)服务器空间
- 读乔布斯传记有感
- javascript位置问题
- java 序列化小demo