java - 如何使用代码动态更改 TextInputLayout 错误颜色和错误文本大小

标签 java android

这是动态更改错误消息颜色和文本大小的代码。

TextInputLayout input
input = new TextInputLayout(this);
input.setTypeface(tf);
input.setLayoutParams(lparams);
input.setTypeface(tf);

最佳答案

您必须使用定义自定义样式并将此行添加到您的 TextInputLayout app:errorTextAppearance="@style/custom_textColor_style"

关于java - 如何使用代码动态更改 TextInputLayout 错误颜色和错误文本大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35811376/

相关文章:

java - 如何循环遍历字符串然后查找该字符串的一部分是否在 arrayList 中

java - jsp mysql插入错误

Android 计时器似乎忽略了 .cancel

java - 尝试使用默认相机应用程序并捕获图像并上传到 Firebase 存储来使用 Firebase

java - OracleTypes.ARRAY 的最大大小

java - Spring MVC中没有参数的@RequestMapping

android - 带有加载本地 html 和 javascript 的 webview 的 Alloy Android 应用示例?

android - 如何在 onCreate 中使用 findViewById() 而不返回 null?

android - 在 Android 中以编程方式强制停止应用程序

java - 包含来自可绘制图像和 Intent 的图像的数组