Search code examples
iphoneiphone-softkeyboard

How can I change the speed of the keyboard slide in/out animation?


I am very confuse with my small test app.When i do on the Textfield the keyboard comes slowly I want to increase the keyboard time.Can anybody tell me that how i can increase the time of KeyBoard up and down?


Solution

  • The speed of the system keyboard can be retrieved via the UIKeyboardAnimationDurationUserInfoKey and is read-only.

    UPDATE: How to get the values. In the notification listener:

    - (void)keyboardWillShow:(NSNotification*)notification 
    {
        NSDictionary* userInfo = [notification userInfo];
        NSTimeInterval animationDuration;
        UIViewAnimationCurve animationCurve;
    
        [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve];
        [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration];
    }