Get color of an element using calabash-android

痴心易碎 提交于 2019-12-04 18:14:07

Unfortunately this is not possible in Android.

In Android the Views (also the TextView) can have almost anything as a background not just a color (a bitmap, a shape, a gradient color, etc). Because of this there is no way to get the background color of a view (it is not stored).

This is not a limitation of Calabash but the Android system. You can get any property of an Android view if it is accessible.

You can query the following colors on the TextView (nothing is background):

  • text color :currentTextColor
  • hintTextColor :hintTextColor
  • highlight color :highlightColor
  • shadow color :shadowColor
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!