android-奇异bug:parameter must be a descendant of this view
来源:互联网 发布:淘宝淘宝联盟怎么用法 编辑:程序博客网 时间:2024/06/14 01:01
项目上线后遇到一个问题:
java.lang.IllegalArgumentException: parameter must be a descendant of this view
at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:5336)
at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:5265)
at android.view.ViewGroup$ViewLocationHolder.init(ViewGroup.java:7775)
at android.view.ViewGroup$ViewLocationHolder.obtain(ViewGroup.java:7709)
at android.view.ViewGroup$ChildListForAccessibility.init(ViewGroup.java:7644)
at android.view.ViewGroup$ChildListForAccessibility.obtain(ViewGroup.java:7612)
at android.view.ViewGroup.addChildrenForAccessibility(ViewGroup.java:1929)
at android.view.ViewGroup.onInitializeAccessibilityNodeInfoInternal(ViewGroup.java:2980)
at android.widget.AdapterView.onInitializeAccessibilityNodeInfoInternal(AdapterView.java:983)
at android.widget.AbsListView.onInitializeAccessibilityNodeInfoInternal(AbsListView.java:1608)
at android.widget.ListView.onInitializeAccessibilityNodeInfoInternal(ListView.java:3909)
at android.view.View.onInitializeAccessibilityNodeInfo(View.java:6097)
at android.view.View.createAccessibilityNodeInfoInternal(View.java:6056)
at android.view.View.createAccessibilityNodeInfo(View.java:6041)
at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:145)
at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:119)
at android.view.View.onInitializeAccessibilityEventInternal(View.java:5993)
at android.widget.AdapterView.onInitializeAccessibilityEventInternal(AdapterView.java:994)
at android.view.View.onInitializeAccessibilityEvent(View.java:5981)
at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:5846)
出现原因:一个这样的View:
AbsListView.LayoutParams params = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, ((int) (202f / 720f * Util.getScreenWidth()) + Util.dip2px(45)));placeHolderViewDiscuss = new LinearLayout(getActivity());placeHolderViewDiscuss.setLayoutParams(params);
给三个ListView中addview,如:
ListView.addHeaderView(placeHolderViewDiscuss);
出现异常崩溃(部分机型),即时加了try{}catch(){}一样无效;
解决方法:
new 3个View,添加到不同的Listview中。
- android-奇异bug:parameter must be a descendant of this view
- Parameter must be a descendant of this view 错误
- Android java.lang.IllegalArgumentException: parameter must be a descendant of this view
- 解决android报错IllegalArgumentException: parameter must be a descendant of this view
- 错误 java.lang.IllegalArgumentException: parameter must be a descendant of this view 的解决方案
- java.lang.IllegalArgumentException: parameter must be a descendant of this view
- 错误 java.lang.IllegalArgumentException: parameter must be a descendant of this view 的解决方案
- java.lang.IllegalArgumentException: parameter must be a descendant of this view 的解决方案
- java.lang.IllegalArgumentException,parameter must be a descendant of this view
- java.lang.IllegalArgumentException: parameter must be a descendant of this view
- 【转载】Parameter must be a descendant of this view问题的解决方案
- java.lang.IllegalArgumentException parameter must be a descendant of this view
- ScrollView中EditText报java.lang.IllegalArgumentException: parameter must be a descendant of this view
- Android解决"parameter must be a descendant of this view(参数必须是此视图的子视图 )"问题的方法
- swift 请小心使用你的get方法,should be a descendant of reference view
- opensuse 13.1 virtualbox error:This parameter must be a string or Unicode object
- Argument for @NotNull parameter 'name' of com/android/tools/idea/welcome/Platform.<init> must not be
- Argument for @NotNull parameter 'name' of com/android/tools/idea/welcome/Platform.<init> must not be
- Linux Centos安装python相关库失败处理方法
- linux进程间通信———内存共享
- Spring Cloud 基于eureka 服务注册中心
- JAVA利用SSH2登录LINUX并执行命令
- 1009. 说反话 (20) python篇
- android-奇异bug:parameter must be a descendant of this view
- html5转为jsp以后,布局全部无效,包括css也没起作用。
- 题目1108:堆栈的使用(谨慎使用scanf("%c",&c))
- Cadence Allegro学习之添加快捷键+锁定+对齐方式
- Linux 网络编程——套接字的介绍
- vs2015 CString 转 const char* 方法
- Matrix Again hdu3376 费用流
- 网易云音乐API分析
- IO之内核buffer----"buffer cache"