2

I have a popup view which I animate in the current view from the bottom using MJPopupViewController and there is a UITextField in that popup view. When I tap on that textfield, instead of animating from the bottom, the keyboard appears immediately. the popup view is a UIViewController and there is nothing fancy in it, no code related to the keyboard. i added observers to related keyboard notifications and saw that the UIKeyboardAnimationDurationUserInfoKey value is 0 even though it is the first time the keyboard is displayed in the app. the keyboard disappears with animation properly, only the animation of keyboard sliding in from bottom is broken. this occurs on iOS 5.0 and 5.1, the keyboard functions properly on iOS 6 +. i'm trying to track down the issue but right now i am out of clues. what causes UIKeyboardAnimationDurationUserInfoKey to be zero, for a start?

1 Answer 1

0

Try adding this.

-(void)textFieldDidBeginEditing:(UITextField *)textField
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.view cache:YES];
    [textField becomeFirstResponder];
    [UIView commitAnimations];
}

PS: We need to set the delegate for this one.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.