Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically show the keyboard on iPhone app

I have a view with only one UITextView that is used to enter a value. I want that when the view shows, the textview becomes the first responder (that's the easy part) and also the default keyboard shows up. I tried searching for this in speca but to no avail. There are many posts on how to dismiss the keyboard, but what I want is to show the keyboard w/o waiting for user to touch my textview.

like image 936
Remus Rusanu Avatar asked May 26 '09 22:05

Remus Rusanu


People also ask

How do you get the keyboard to appear on iPhone?

Go to Settings > Accessibility > Keyboards, tap Full Keyboard Access, then turn on Full Keyboard Access.

How do I know if my keyboard is visible IOS?

If value of editCounter becomes 1 - this means that keyboard will appear (in case if you return YES). If editCounter > 1 - this means that keyboard is already visible and another UITextField holds the focus.

How do I make my iPhone keyboard auto hide?

To hide it, slide your finger down from above the text-entry box and the keyboard will start to disappear. Carry on until only the text-entry box is left. To make the keyboard reappear, tap the text-entry box and it will shoot right back up so text can be entered again.


1 Answers

Just setting the text field to firstResponder should do the trick.

Inside your -viewDidLoad:

[myTextField becomeFirstResponder];
like image 134
pix0r Avatar answered Sep 17 '22 22:09

pix0r