我的布局中有多个TextInputLayouts,我需要验证字段(如果字段无效,则显示错误文本)。
但是 TextView 包含错误的 TextInputLayout 文本框 .
TextView
TextInputLayout
文本框
所以问题是:即使没有显示错误,我也能为错误文本保留空间吗?
在你的 textInputLayout 添加以下内容: app:errorEnabled="true"
textInputLayout
app:errorEnabled="true"