-2

テーブル ビューに 15 個のテキスト フィールドがあるという問題があります。最後のテキスト フィールドにテキストを入力すると、キーボードで覆われています。どなたか解決策を教えてください。

私のテキストフィールドは、IPAD の分割ビューの詳細ビュー コントロールにあります。

解決策を事前にありがとう

4

2 に答える 2

0

// テキストフィールドの編集開始時に呼び出す

-(void)textFieldDidBeginEditing:(UITextField *)textField{

        [self animateTextField: indexPath up: YES];

}

//編集終了後のテキストフィールド

  • (void)textFieldDidEndEditing:(UITextField *)textField{

    [self animateTextField: indexPath up: NO];
    

}

// animateTextField のコード。移動距離は要件に応じて変更されます

  • (void) animateTextField: (NSIndexPath*) indexPath up: (BOOL) up{

    const int MovementDistance =indexPath.section==0?20: 180;

    const float 移動時間 = 0.3f;

    int 移動 = (上 ? -移動距離 : 移動距離);

    NSLog(@"movement:%d",movement);

    [UIView beginAnimations: @"aimation" コンテキスト: nil];

    [UIView setAnimationBeginsFromCurrentState: はい];

    [UIView setAnimationDuration: MovementDuration];

    self.view.frame= CGRectOffset(self.view.frame,0, 動き);

    [UIView commitAnimations];

}

于 2013-06-05T05:25:50.897 に答える