2012-11-20 69 views
-2

我的程序有UIToolBar,其中包含UITextFieldUIButton。当软键盘出现时,整个视图(self.view)就会出现。当UIToolBar移动到新的位置时,该按钮有时不会正确捕获事件。点击按钮需要点击一个事件。动画UIButton不愿意捕捉事件

当键盘出现

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:0.25]; 
self.view.frame = CGRectMake(0,-220,320,400); 
tableView.frame = CGRectMake(10, 220, 320, 264); 
[UIView commitAnimations]; 
+0

的[词在iPhone屏幕上方落下](HTTP可能重复执行下面的代码集:// stackoverflow.com/questions/8222466/words-falling-from-the-top-of-screen-in-iphone) - 请参阅我的答案,关于presentationLayer和touch物件的动画处理 – jrturton

回答

0

试试这个

[UIView animateWithDuration:0.25 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ 
    self.view.frame = CGRectMake(0,-220,320,400); 
    tableView.frame = CGRectMake(10, 220, 320, 264); 
}completion:^(BOOL finished) {}]; 
+0

仍然不起作用。一旦动画完成,它需要点击几下。按钮的某些部分根本没有响应。 –