AndroidRuntime: FATAL EXCEPTION: main java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to androidx.constraintlayout.widget.ConstraintLayout$LayoutParams
我在Android中有一个带有viewpager的布局(布局的粉色部分):
java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams
R.layout.frame_header, null);mLayout.addView(header);java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams
-更新-04-21 11:42:01.807: E/AndroidRuntime(1456): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams
我有以下代码: LinearLayout.LayoutParamsbtnBarParams = new LinearLayout.LayoutParams(screenWidth,screenHeight / 3);
//Not sure how to set thebtnBarParams = new LinearLayout.LayoutParams(screenWid