代码之家  ›  专栏  ›  技术社区  ›  artem

是否可以在TextInputLayout中为错误标签保留空间?

  •  0
  • artem  · 技术社区  · 5 年前

    我的布局中有多个TextInputLayouts,我需要验证字段(如果字段无效,则显示错误文本)。

    但是 TextView 包含错误的 TextInputLayout 文本框 .

    所以问题是:即使没有显示错误,我也能为错误文本保留空间吗?

    1 回复  |  直到 5 年前
        1
  •  5
  •   Suraj Vaishnav    5 年前

    在你的 textInputLayout 添加以下内容: app:errorEnabled="true"