在我的故事板中,我有一个触发模态segue的按钮。当它没有触发任何移动它的动画时,它按预期工作。但是,当 触发移动它的动画时,它不会触发segue。
其他信息:
view
时会触发动画view
“跟随”键盘。 segue是通过故事板创建的[UIView beginAnimations:context:]
方法,但它仍无效。代码:
[[NSNotificationCenter defaultCenter] addObserverForName:UIKeyboardWillHideNotification object:nil queue:nil usingBlock:^(NSNotification *notification){
CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
CGRect newFrame = view.frame;
//newFrame.origin.y += offset > keyboardFrame.size.height ? keyboardFrame.size.height : keyboardFrame.size.height - offset;
UIView animateWithDuration:.25 delay:0 options:(UIViewAnimationCurveLinear | UIViewAnimationOptionAllowUserInteraction) animations:^{
view.frame = newFrame;
}completion:nil];
}];