Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

iPad横屏显示时,鼠标点击坐标与实机响应坐标不符 #7

Open
zhenniuren opened this issue Jun 27, 2018 · 4 comments
Open

Comments

@zhenniuren
Copy link

iPad横屏显示时,鼠标点击坐标与实机响应坐标不符。

@codeskyblue
Copy link
Member

好像以前也有这个问题

@zhenniuren
Copy link
Author

能否修复?

因为还不会go和js语言,所以我仅尝试修改remote-control.html,在initScreenSize: function()中:
this.display.width = ret.value.height;
this.display.height = ret.value.width;
这样修改后,iPad横屏显示系统界面时,鼠标点击坐标与实机响应坐标一致。
但进入其他程序,坐标又会不符。

@codeskyblue
Copy link
Member

最好还是能从WDA层面解决,这个应该是wda的bug

@zhenniuren
Copy link
Author

zhenniuren commented Jul 2, 2018

恩 直接使用Facebook WebDriverAgent Python Client Library (not official),将设备朝向设置为landscape(left)后,坐标正常了。
附上代码:
import wda
client = wda.Client()
session = client.session()
#设置为横屏模式:横向,home键向右
session.orientation = wda.LANDSCAPE

感谢codeskyblue、shengxiang的辛苦工作

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants