检测国际键盘的出现和消失

发布于 2025-01-01 01:53:14 字数 86 浏览 5 评论 0原文

当键盘出现时,有没有办法检测它是国际键盘(普通键盘顶部有一条额外的丝带以显示国际字符)并获取它的框架大小?我需要使用该信息向上移动(如果需要)键盘上方的视图。

When a keyboard appears, is there a way to detect that it's an international keyboard (with an extra ribbon on top of normal keyboard to show the international characters) and also get it's frame size? I need to use that info to move upward (if needed) the view above the keyboard.

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

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

发布评论

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

评论(1

七秒鱼° 2025-01-08 01:53:14

查看这篇文章:http: //mobile.tutsplus.com/tutorials/iphone/ios-sdk-keeping-content-from-underneath-the-keyboard/

它解决了您的大部分问题。除了通知之外,文本视图将成为或放弃“第一响应者”,这将调出或隐藏键盘视图。

至于键盘是否显示国际字符,我不太确定该怎么做。但是,如果您获得键盘的框架大小(如教程中所述),您可以相应地调整您的视图,假设这是您所关心的。

更新

另请查看:键盘调整大小iOS 5 中的事件(中文键盘错误)?

Check out this article: http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-keeping-content-from-underneath-the-keyboard/

It addresses most of your questions. In addition to notifications, text views will become or resign 'first responder' which will bring up or hide a keyboard view.

As for whether or not the keyboard shows international characters, I'm not really sure how to do that. However, if you get the frame size of the keyboard (as described in the tutorial) you can adjust your view accordingly assuming that this was your concern.

UPDATE

Also check out: Keyboard resize event in iOS 5 (Chinese keyboard bug)?

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