UITextField fails to show keyboard after MFMailComposeViewController is dismissedContent on this page is from Stackoverflow
I have an issue where the keyboard shows correctly when a UITextField is displayed, but then fails to appear after a MFMailComposeViewController is presented and dismissed. The cursor appears in the textfield, but no keyboard.
Basically, a UIView is added to the current view that contains the UITextField when the user taps a 'Create Preset' button:
[self.view addSubview:createPresetView]; [presetNameField becomeFirstResponder];
That works. The user can add multiple new presets, each time the view is added, the textfield becomes first responder, and the keyboard appears. To rule out issues with the presetNameField not being in the view hierarchy I've also tried doing becomeFirstResponder after a 1 second delay - same results.
Next, a preset can be shared via email, using a standard MFMailComposeViewController:
MFMailComposeViewController *mailView = [[MFMailComposeViewController alloc] init]; [mailView setMailComposeDelegate:appController]; [mailView setSubject:@"New preset"]; [mailView setMessageBody:@"\n\nMail from app" isHTML:NO]; [appController presentModalViewController:mailView animated:YES];
The mail compose view dismisses correctly so far as I can tell:
[controller.view endEditing:YES]; // I added this as a test to ensure the mail view resigns first responder, no difference. [self dismissModalViewControllerAnimated:YES]; [controller release]; controller = nil;
But now the Create Preset button adds the view with the text field, sets the textfield as first responder, but no keyboard ever appears.
I've checked out what's happening when I do becomeFirstResponder on the textfield. The textfield itself is valid, and returns YES to canBecomeFirstResponder.
The only potential clue I've found is that [presetNameField becomeFirstResponder] always returns NO (even before the mail view is shown).
View Local Answers... Can't find the answer to this question?
No answers yet.
Can you answer this question?
UITextField fails to show keyboard after MFMailComposeViewController is dismissed
Can you answer these?
- Answer New entity in repeated StructuredProperty stored as a _BaseValue
- Answer php file path/file extension not saving to database in sql
- Answer Manage almost identical data structures in C
- Answer Timing the movement of Sprites
- Answer Android GCM - crashing when creating the notification on the client
- Answer How can I export/extract the TableBox data from another windows application?
- Answer Actual name of the passed parameter
- Answer Rewind the file pointer to the beginning of the previous line
- Answer Powershell: For each loop using where -eq
- Answer c# block ip by hwid from a text file