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

查看:69
本文介绍了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 文本颜色是由应用到您的 Activity 的当前主题确定的.


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

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

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