Products
GG网络技术分享 2025-11-26 18:14 3
先说说 我们要在布局文件里面放一个EditText,就像这样:

EditText editText = findViewById;
Drawable background = editText.getBackground;
if {
background.mutate).setStroke;
}
这里我们用了一个叫ZuoGradientDrawable的东西,它Neng帮我们设置下划线的颜色哦!是不是hen神奇?
这样我们就Neng在布局文件里面引用这玩意儿drawable文件了 就像这样:
EditText editText = findViewById;
Drawable background = editText.getBackground;
if {
background.mutate).setStroke;
editText.setHintTextColor;
editText.setHighlightColor;
}
优良了今天的课程就到这里啦!希望你们Neng中意今天的分享,也希望巨大家Neng在实际的项目中用得上这些个技巧!下次再见啦!
Demand feedback