我的 Android 应用程序中有一个文本字段(EditView),如果它的值无效或为空,它会更改颜色(边框)。在这种情况下, label(TextView) 也会改变它的颜色。
当我尝试使用 TextViewquery
时,我看到以下内容:
[0] {
"id" => "field_lable",
"enabled" => true,
"contentDescription" => nil,
"class" => "android.widget.TextView",
"text" => "Name",
"rect" => {
"center_y" => 198.5,
"center_x" => 51.0,
"height" => 27,
"y" => 185,
"width" => 82,
"x" => 10
},
"description" => "android.widget.TextView@a28btb00"
}
如果我需要获取文本,我可以使用query("TextView id:'field_label'", :text)
葫芦中有什么方法可以获取TextView的颜色吗?