在Android10中,由于support 库太乱了,谷歌在新版本中取消了support库,使用了新的andriodX库。而TextInputLayout在support库中,所以它的配置也跟着改变了。之前应该在gradle(app)中进行如下配置:
implementation 'com.android.support:design:28.0.0'
现在改为:
implementation 'com.google.android.material:material:1.2.1'
然后在xml文件中编写如下:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.google.android.material.textfield.TextInputLayout>