以编程方式显示 iPhone 键盘

发布于 2024-09-01 07:31:24 字数 41 浏览 4 评论 0原文

我想展示 iphone 键盘。如何编写代码(以编程方式)来显示键盘。

I want show the iphone keyboard. How can I write the code (programmatically) to show the keyboard.

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

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

发布评论

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

评论(2

著墨染雨君画夕 2024-09-08 07:31:24

正如 Jacob 所说,您必须在 UITextView 上运行 becomeFirstResponder 才能使其成为第一响应者,即用户当前正在使用的对象。如果您这样做,iPhone 操作系统会自动显示键盘,因为从用户角度来看,这是使用 UITextView 所需要的。

As Jacob said, you'll have to run becomeFirstResponder on a UITextView to make it the first responder, the object the user's currently working with. If you do this, the iPhone OS automatically shows the keyboard, cause that's what's needed for working with a UITextView from a user perspective.

π浅易 2024-09-08 07:31:24

正如其他人所指出的,您将 becomeFirstResponder 消息发送到您希望键盘编辑的控件。

您应该注意的另一件事是,如果您将外部键盘插入 iPad,则键盘将不会出现在屏幕上。您需要设计您的视图,使其在没有屏幕键盘的情况下看起来不会很愚蠢。

As others have noted, you send the becomeFirstResponder message to the control that you want the keyboard to edit.

One extra thing you should be aware of is that if you plug an external keyboard into an iPad then the keyboard will not appear on screen. You need to design your view so it doesn't look silly without the on-screen keyboard.

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