What is the iPhone's default keyboard animation rate?

前端 未结 7 1855
萌比男神i
萌比男神i 2020-12-13 13:21

A while ago I remember seeing a constant of some kind that defined the animation rate of the Keyboard on the iPhone and I can not for the life of me remember where I saw it.

7条回答
  •  有刺的猬
    2020-12-13 13:49

    Swift 4 - worked for me:

            if let duration = notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as? Double {
                UIView.animate(withDuration: duration, animations: {
                    self.view.layoutIfNeeded()
                })
            }
    

    In debug mode my duration was 3.499999

提交回复
热议问题