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

 

posted @ 2020-10-07 08:40  sunny开始学坏  阅读(391)  评论(0编辑  收藏  举报