2 Replies Latest reply: Oct 21, 2009 11:05 PM by RaidenMAC
RaidenMAC Level 1 Level 1 (0 points)
Hi guys.
I am new developer for the iPhone.
To test the application, I am using iPhone Simulator 3.0. (UIView and UITextField)
My problem is Keyboard is not appearing when finished text editing.

I wanna it doesn't appear after editing.

How to do it ?

Thanks in advance.

iMac, iPhone OS 3.0
  • RayNewbie Level 5 Level 5 (6,810 points)
    RaidenMAC wrote:
    I wanna it doesn't appear after editing.

    Hi Raiden -
    The keyboard will be dismissed as soon as the text field is no longer "first responder". For example, if you want the keyboard to disappear when the Return key is tapped, you can ask the text field to give up first responder status in the textFieldShouldReturn: delegate method like this:

    - (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
    // When the user presses return, take focus away from the text field so that the keyboard is dismissed.
    [textField resignFirstResponder];
    return YES;

    The above code is usually put in the controller of the view which contains the text field. However for a very simple program, you could use the app delegate as the controller. In any case, the object which includes the above method _must be connected as the delegate of the text field_. For an example of this, take a look at the HelloWorld sample app.

    Hope that's what you wanted to know!
    - Ray
  • RaidenMAC Level 1 Level 1 (0 points)
    So cool. Thanks a lot.