UITextField fails to show keyboard after MFMailComposeViewController is dismissed
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).
No responses yet. Be the first one!
Can you answer these?
- Answer Upgraded OEM Windows 7 Home premium to professional. Was never asked for a product key. Why not?
- Answer Mouse invisible after KB2993651 on Win7 - what now ?
- Answer I am demeted with this pop up - how do I get rid???
- Answer Need help with a recording stereomix for music
- Answer Building a PC so do I need a new copy of Windows?