に追加UITextView
しUIToolBar
ます。終了するUITextView
と、キーボードは非表示になりましたが、テキストも表示されたままです。
UITextView
写真のリンクを開始すると:
UITextView
写真のリンクが完成したら:
に追加UITextView
しUIToolBar
ます。終了するUITextView
と、キーボードは非表示になりましたが、テキストも表示されたままです。
UITextView
写真のリンクを開始すると:
UITextView
写真のリンクが完成したら:
キーボードが表示されているときは、ビューを上下にアニメーション化する必要があります。お気に入り :
[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 値を調整できます。次に、キーがなくなったら逆のプロセスを実行します。
- (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;
}];
}