有没有办法找出是否显示软件键盘?

发布于 2024-07-26 07:45:26 字数 155 浏览 5 评论 0原文

我实际的 UITextField 控件嵌入在外部库中的许多层中。 因此,我无法通过调用

control isFirstResponder 来检测它是否正在被编辑。

还有其他方法可以检测是否显示软件键盘吗?

My actual UITextField control is embedded many layers down in an external library. Therefore I am unable to detect if it is being edited by calling

control isFirstResponder.

Is there another way to detect if the software keyboard is shown?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋心╮凉 2024-08-02 07:45:26

是的,尝试为“UIKeyboardWillShowNotification”等通知设置侦听器。 在通知的 userInfo 中,您可以获取键盘的边界,从而确定它是否可见(在屏幕上)。 查看 UIWindow.h。

Yes, try setting up a listener for notifications such as "UIKeyboardWillShowNotification". In the userInfo for the notification you can get the bounds for the keyboard and thus determine if it is visible (on screen) or not. Look in UIWindow.h.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文