TextInputLayout错误文本填充 [英] TextInputLayout error text padding

查看:270
本文介绍了TextInputLayout错误文本填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 TextInputLayout AppCompatEditText 结合使用,该背景具有针对 AppCompatEditText 的基于XML形状的自定义背景.每当我设置一些错误时,错误行就会从布局的开头开始.有什么办法可以给该错误行加上填充.

I am using TextInputLayout with AppCompatEditText having a custom xml shape based background for AppCompatEditText. Whenever i set some error , the error line starts from beginning of layout. Is there any way to give padding to that error line.

推荐答案

您可以使用以下方法引用错误的TextView:

You can reference error TextView by using:

TextView textView = (TextView) inputLayout.findViewById(android.support.design.R.id
            .textinput_error);

然后,您可以使用其布局参数.

Then you can get its layout params to work with.

这篇关于TextInputLayout错误文本填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆