【发布时间】:2021-04-15 13:14:19
【问题描述】:
当我在编辑文本中添加错误消息时。
我看到了图标,但是点击图标后默认不会出现错误提示
这是我的布局文本
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerVertical="true"
android:hint="@string/enter_client_name">
<com.google.android.material.textfield.TextInputEditText
app:errorEnabled="true"
android:id="@+id/editTextClientName"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
这是java代码:
if(t.getClientName().equals("")){
editTextClientName.setError( "Client name is required!" );
return false;
}
【问题讨论】:
标签: android material-design material-components-android