UIKeyboardAnimationDurationUserInfoKey
is a const string identifier for the dictionary key that holds the animation duration, so there is no way to change it easily.
One way to make the keyboard appear without animation is to observe the keyboard notifications and disable animation when it's about to appear and then reenable them. This, of course, disables any other animation as well.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(willShowKeyboard:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didShowKeyboard:)
name:UIKeyboardDidShowNotification
object:nil];
- (void)willShowKeyboard:(NSNotification *)notification {
[UIView setAnimationsEnabled:NO];
}
- (void)didShowKeyboard:(NSNotification *)notification {
[UIView setAnimationsEnabled:YES];
}
and then then the same for UIKeyboardWillHideNotification/UIKeyboardDidHideNotification
notifications.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…