I have a tableview that accepts login credentials. I would like to have my app automatically select the first tableview text box upon loading or appearing. I would like the cursor to be placed in the "Email Address" field and for the keyboard to be raised automatically. I can't seem to figure this out. Anyone have any ideas? Thank you!
You have to assign the first responder to that UITextView
...
For example:
[textField becomeFirstResponder]
You can do it in the viewDidAppear of the UIViewController.
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
myTextField = (UITextField *)[cell viewWithTag:kMyTextFieldTag];
[myTextField becomeFirstResponder];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With