Show iPhone keyboard programmatically
Asked Answered
G

2

8

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

Ga answered 10/5, 2010 at 8:39 Comment(1)
Possible duplicate of #260319Daffy
S
17

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.

Stores answered 10/5, 2010 at 9:0 Comment(0)
G
9

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.

Gherardi answered 10/5, 2010 at 9:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.