0

私のプログラムでは、ページの下部にある UITextField がソフト キーボードで覆われているため、次のコードを使用して self.view をアニメーション化しています。

- (IBAction)moveViewUp:(UITextField *)textField
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.25];
    self.view.frame = CGRectMake(0,-150,320,400);
    [UIView commitAnimations];

}

次のコードは、ビューを元の位置に戻します。

- (IBAction)moveViewDown:(UITextField *)textField
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.25];
    self.view.frame = CGRectMake(0,0,320,400);
    [UIView commitAnimations];

}

ただし、両方のメソッドが実行されると、画面は非常に正常に見えますが、画面内の UIButton はタッチのキャプチャを停止します。

どんなヒントでも大歓迎です。

4

0 に答える 0