Alex Rivera | Logout

Changing the iOS keyboard animation time

Asked 2011-09-24T23:02:32.550
9

Is there a way to change the time the iOS keyboard animation takes?

Edit
Report

1 Answer

16

I've actually found a better solution. What you can do is programmatically make the textfield or textview a first responder within an animation with duration of your choice. Example for making the keyboard emerge over the course of one second might be:

[UIView animateWithDuration:1.0 animations:^
{
     [myTextField becomeFirstResponder];
}];

Similarly, you can make the keyboard disappear like this:

[UIView animateWithDuration:1.0 animations:^
    {
         [myTextField resignFirstResponder];
    }];
answered 2011-11-11T02:13:43.333

Your Answer