-1

に追加UITextViewUIToolBarます。終了するUITextViewと、キーボードは非表示になりましたが、テキストも表示されたままです。

UITextView写真のリンクを開始すると:

ここに画像の説明を入力

UITextView写真のリンクが完成したら:

ここに画像の説明を入力

4

2 に答える 2

0

キーボードが表示されているときは、ビューを上下にアニメーション化する必要があります。お気に入り :

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
CGRect rect=self.view.frame;
rect.origin.y=rect.origin.y-100;
self.view.frame=rect;
[UIView commitAnimations];

要件に応じて、その 100 値を調整できます。次に、キーがなくなったら逆のプロセスを実行します。

于 2013-06-28T06:00:32.723 に答える
0
- (void)keyboardWasShown:(NSNotification*)aNotification
{
    NSDictionary* info = [aNotification userInfo];
    CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;

    [UIView animateWithDuration:0.2f animations:^{

        CGRect frame = textInputView.frame;
        frame.origin.y -= kbSize.height;
        textInputView.frame = frame;

        frame = bubbleTable.frame;
        frame.size.height -= kbSize.height;
        bubbleTable.frame = frame;
    }];
}

- (void)keyboardWillBeHidden:(NSNotification*)aNotification
{
    NSDictionary* info = [aNotification userInfo];
    CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;

    [UIView animateWithDuration:0.2f animations:^{

        CGRect frame = textInputView.frame;
        frame.origin.y += kbSize.height;
        textInputView.frame = frame;

        frame = bubbleTable.frame;
        frame.size.height += kbSize.height;
        bubbleTable.frame = frame;
    }];
}
于 2013-06-28T06:19:58.783 に答える