我正在使用 AndroidViewClient 来查找 EditText 和 Buttons 以使用 monkeyrunner 推送。问题是 AndroidViewClient 无法获取这些视图的坐标(以像素为单位)。
结果说明了下一个:
com.android.launcher.BubbleTextView id/0x80203 Browser (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/0x80002 has no 'layout:mLeft' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/0x80002 has no 'layout:mTop' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
com.android.launcher.BubbleTextView id/0x80002 Messaging (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/cell3 has no 'layout:mLeft' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/cell3 has no 'layout:mTop' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
com.android.launcher.CellLayout id/cell3 None (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/drawer has no 'layout:mLeft' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/drawer has no 'layout:mTop' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
android.widget.SlidingDrawer id/drawer None (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/all_apps has no 'layout:mLeft' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/all_apps has no 'layout:mTop' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
com.android.launcher.HandleView id/all_apps None (0, 0)
com.android.launcher.AllAppsGridView id/content None (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/name has no 'layout:mLeft' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/name has no 'layout:mTop' property
warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
android.widget.TextView id/name Alarm Clock (0, 0)
android.widget.TextView id/name API Demos (0, 0)
android.widget.TextView id/name Browser (0, 0)
android.widget.TextView id/name Calculator (0, 0)
android.widget.TextView id/name Camera (0, 0)
android.widget.TextView id/name Contacts (0, 0)
android.widget.TextView id/name Custom Locale (0, 0)
android.widget.TextView id/name Dev Tools (0, 0)
android.widget.TextView id/name Email (0, 0)
android.widget.TextView id/name Gallery (0, 0)
android.widget.TextView id/name Gestures Builder (0, 0)
android.widget.TextView id/name Messaging (0, 0)
android.widget.TextView id/name Music (0, 0)
android.widget.TextView id/name Phone (0, 0)
android.widget.TextView id/name Settings (0, 0)
android.widget.TextView id/name Spare Parts (0, 0)
com.android.launcher.DeleteZone id/delete_zone None (0, 0)
这个问题有什么解决办法吗?视图是否有必要具有确定的这些属性?
谢谢你的帮助。