Keyboard shows then immediately hides itself when showing MFMessageComposeViewController Keyboard shows then immediately hides itself when showing MFMessageComposeViewController objective-c objective-c

Keyboard shows then immediately hides itself when showing MFMessageComposeViewController


You must add MessageUI.framework to your Xcode project and include a

#import <MessageUI/MessageUI.h> in your header file.

try this code may be its helpful to you..

[self presentModalViewController:picker animated:YES];//[self becomeFirstResponder];//try picker also instead of self

Also Refer this bellow tutorial and also check demo..

  1. new-tutorial-developing-and-architecting-a-phonegap-application

  2. SMSComposer

i hope this help you...


I encountered these symptoms with a Sencha Touch 2.2 and Cordova 2.6.0 setup (specifically, iOS 6+ devices).

The issue was with the web framework stealing focus away from the native SMS Composer modal, typically occurring after the first SMS Composer modal had been successfully displayed and closed.

A event.preventDefault() and event.stopPropagation() call once the event had been fired (or event.stopEvent() in Sencha land) resolved this.

Hope this helps,

-James


First: The most likely culprit, without seeing your code, is that your parent (presenting) view controller may have an action in its viewWillDisappear or viewDidDisappear that is affecting who has the "first" responder. These methods get called when presenting a view controller modally. It may be behaving differently on the simulator than the device due to timing - often really close timing conditions are different on the ARM device and the i386 processor.

Second: Does anywhere in your app register for the UIKeyboardWillShowNotification or the UIKeyboardDidShowNotification? If so, put breakpoints in the methods that are called as a result - it's possible some other controller in your view hierarchy is interfering with this one.

To answer your question...

Is there any way to 'force' the keyboard to display, or possibly put the whole modalviewcontroller as first responder in some form or fashion?

No to both. The only way to make the keyboard display is to call the becomeFirstResponder method of the input view. Since Apple doesn't expose the text view, you cannot send it messages. Setting the modalViewController as first responder would be setting the wrong object.