IOS隐藏键盘而不关闭对话框

IOS隐藏键盘而不关闭对话框

本文介绍了如何使用Appium for IOS隐藏键盘而不关闭对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个对话框出现,并用hideKeyboard();关闭键盘时,所有表格都关闭了,我回到了主页,所以我无法继续填充其他数据的情况.

I have a dialog box that appears and while closing keyboard with hideKeyboard(); all the form is closed and i get back to the home page so that i can't continue the scenario for filling other data.

在这里屏幕:

推荐答案

hideKeyboard();的默认策略"是在键盘外部点击,但是可以将其更改为改为按下键盘上的键.

The default "strategy" of hideKeyboard(); is to tap outside the keyboard, but this can be changed to pressing a key on the keyboard instead.

有关可用的hideKeyboard策略,请参阅Java客户端文档(假设您正在使用Java客户端?): http://appium.github.io/java-client/io/appium/java_client/ios/IOSDeviceActionShortcuts.html

See the java-client documentation (assuming you're using java-client?) for available hideKeyboard strategies: http://appium.github.io/java-client/io/appium/java_client/ios/IOSDeviceActionShortcuts.html

例如,如果您应用的键盘上有一个下一步"按钮来关闭键盘,那么您可以使用:driver.hideKeyboard("Next");

If your app's keyboard has for example a "Next" button to close the keyboard with, then you could use: driver.hideKeyboard("Next");

这篇关于如何使用Appium for IOS隐藏键盘而不关闭对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 01:34