2
我不知道如何获取按钮的文本的当前颜色。我知道它可能是这个,但不能完全弄清楚这些参数。如何在Android中获取当前Button文本颜色?
public static int getTextColor (Context context, TypedArray attrs, int def)...
基本上我试着这样做
if(text is RED)
{make text BLACK}
else
{make text RED}
我知道如何设置文本颜色。
mButton.getTextColors()。getDefaultColor()给我-1 – 2011-06-02 05:24:44
-1指Color.WHITE ... mList.getDefaultColor()返回了一个颜色的恒定值。 – 66CLSjY 2011-06-02 05:31:28
很好的答案..谢谢:) – Venky 2012-12-14 05:21:31