How to mimic Keyboard animation on iOS 7 to add “Done” button to numeric keyboard?

前端 未结 7 1043
故里飘歌
故里飘歌 2020-12-02 10:09

I had been doing something like this to mimic the keyboard animation on older version of iOS.

CGRect keyboardBeginFrame;
[[note.userInfo objectForKey:UIKeybo         


        
7条回答
  •  忘掉有多难
    2020-12-02 10:48

    I had the same issue and managed to get the animation working with the following parameters for iOS 7:

        [UIView animateWithDuration:0.5
                              delay:0
             usingSpringWithDamping:500.0f
              initialSpringVelocity:0.0f
                            options:UIViewAnimationOptionCurveLinear
                         animations:animBlock
                         completion:completionBlock];
    

    EDIT: these values were obtained through debug, and can change with new iOS versions. @DavidBeck's answer works for me in iOS 7 also so I'm linking it here.

提交回复
热议问题