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....any insight?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Keep constant number of visible circles in 3D anim
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
UIKeyboardAnimationDurationUserInfoKey now is a NSNumber object, that makes the code shorter.
UIKeyboardAnimationDurationUserInfoKey The key for an NSValue object containing a double that identifies the duration of the animation in seconds.
Swift 4 - worked for me:
In debug mode my
duration
was3.499999
Since this is the first google hit, I'd like to point out that hard-coding 0.3 will mean that your view will incorrectly animate when international users (e.g. Japanese) swap between different-sized keyboards (when that action ought to be instant).
Always use the notification's userInfo dictionary's UIKeyboardAnimationDurationUserInfoKey value - it gets set to 0 when the user is flicking through keyboards.
To add a bit more to what Shaggy Frog wrote. The full implementation would be something like: