TextView tv = (TextView)solo.getView(TextView.class,4);
ColorDrawable dr = (ColorDrawable) tv.getBackground();
int col_int = dr.getColor();
Log.d("TestPhone", Color.RED+" 红色的数字");
Log.d("TestPhone", col_int+" 获取的颜色");
assertEquals("The result is ", col_int, Color.RED);
如下图:
本文来自:http://blog.csdn.net/kefanpipi/article/details/12168697
|