首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AndroidViewClient未获取视图的坐标

AndroidViewClient未获取视图的坐标
EN

Stack Overflow用户
提问于 2013-06-05 00:51:25
回答 1查看 338关注 0票数 0

我正在和AndroidViewClient合作,寻找monkeyrunner的EditText和按钮。问题是AndroidViewClient无法获得这些视图的坐标(以像素为单位)。

结果是下一个:

代码语言:javascript
复制
                   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)

这个问题有什么解决方案吗?视图有必要明确这些属性吗?

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-06-06 01:56:49

API level 7并不完全受AndroidViewClient支持,但事实证明,大多数功能都与支持的API level 8相同。一个小小的修复就解决了这些问题。

尝试一下最新的AndroidViewclient版本(2.3.20),你就会好起来。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16923346

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档