Changing the iOS keyboard animation time

前端 未结 1 1813
野性不改
野性不改 2021-01-05 05:15

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

1条回答
  •  孤街浪徒
    2021-01-05 06:10

    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];
        }];
    

    0 讨论(0)
提交回复
热议问题