Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I show the keyboard by default in UITextView?

I want to create a view that consists solely of a UITextView. When the view is first shown, by default, I'd like the keyboard to be visible and ready for text entry. This way, the user does not have to touch the UITextView first in order to begin editing.

Is this possible? I see the class has a notification called UITextViewTextDidBeginEditingNotification but I'm not sure how to send that, or if that is even the right approach.

like image 411
bpapa Avatar asked Nov 03 '08 20:11

bpapa


People also ask

How do I enable the keyboard in Swift?

To enable SwiftKey and make it your default keyboard on stock Android, head to settings, select Language & input, and choose SwiftKey from the list of options. The keyboard is also available for free in Apple's App Store for iPhone, iPad, and iPod touch devices running iOS 8.

How do I get the height of a swift key?

Swift. You can get the keyboard height by subscribing to the UIKeyboardWillShowNotification notification.


1 Answers

to accomplish that just send the becomeFirstResponder message to your UITextField, as follows (assuming you have an outlet called textField, pointing to the field in question):

- (void)viewWillAppear:(BOOL)animated {     [super viewWillAppear:animated];     [textField becomeFirstResponder]; } 
like image 144
Adam Alexander Avatar answered Sep 24 '22 04:09

Adam Alexander