android判断文本颜色是否等于设定值
android判断文本颜色是否等于设定值
代码:
public boolean isColor(TextView textView,String hexColor ){ String color=Integer.toHexString(textView.getCurrentTextColor()); return hexColor.equals(color); }
用法:
boolean flg = isColor(textView,"ffff0000"); //相同返回True 不同返回False