-2

私のプログラムには、UIToolBarと を含む がUITextFieldありUIButtonます。全体図 ( self.view) は、ソフト キーパッドが表示されると移動します。がUIToolBar新しい位置に移動すると、ボタンがイベントを正しくキャプチャしない場合があります。1 つのイベントを発生させるには、ボタンを数回クリックする必要があります。

キーボードが起動すると、次のコード セットが実行されます。

[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];
4

1 に答える 1

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) {}];
于 2012-11-20T22:24:12.323 に答える