什么是textview中文本的默认颜色? [英] What is default color for text in textview?

查看:420
本文介绍了什么是textview中文本的默认颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将颜色设置为红色,之后我想将颜色重新设置为默认颜色,但我不知道什么是默认颜色,有没有人知道?

I set the color to red , and after that I want to set the color again back to default, but I do not know what is default color, does anyone knows ?

推荐答案

您可以保存旧颜色,然后使用它来恢复原始值。这里是一个例子:

You can save old color and then use it to restore the original value. Here is an example:

ColorStateList oldColors =  textView.getTextColors(); //save original colors
textView.setTextColor(Color.RED);
....
textView.setTextColor(oldColors);//restore original colors






但一般来说,默认 TextView 文本颜色由应用于您的 / code>。


But in general default TextView text color is determined from current Theme applied to your Activity.

这篇关于什么是textview中文本的默认颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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