我在我的 EditText 字段中添加了一堆 TextInputLayout 包装器。我得到了例外
ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to androidx.constraintlayout.widget.ConstraintLayout$LayoutParams
什么可能导致这种情况?
我在我的 EditText 字段中添加了一堆 TextInputLayout 包装器。我得到了例外
ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to androidx.constraintlayout.widget.ConstraintLayout$LayoutParams
什么可能导致这种情况?
基本上,您应该选择LayoutParams
取决于父母。在您的情况下,您可能已经使用FrameLayout.LayoutParams
而不是ConstraintLayout.LayoutParams
.
我的约束布局中的另一个元素之前引用了我的 EditText 的 id 作为其定位参考。必须更改它以引用现在包含 EditText 的 TextInputLayout 的 id。Android Studio 确实在资源文件文本中将引用标记为红色,但我必须向下滚动才能看到它,并且在我构建项目时它什么也没说(或者我什么也没看到)。