この情報を取得する必要があります。プログラムでキーボードを閉じるかどうかを検出し、uitextview でキーボードをタップして閉じる方法を教えてください。二人とも呼んだ
-(BOOL)textViewShouldEndEditing:(UITextView *)textView
しかし、その違いをどのように検出するのですか?誰かが私に手がかりを与えることができますか?
この情報を取得する必要があります。プログラムでキーボードを閉じるかどうかを検出し、uitextview でキーボードをタップして閉じる方法を教えてください。二人とも呼んだ
-(BOOL)textViewShouldEndEditing:(UITextView *)textView
しかし、その違いをどのように検出するのですか?誰かが私に手がかりを与えることができますか?
通知オブザーバーを作成して、特定のイベントをリッスンできます。
// Each notification includes a nil object and a userInfo dictionary containing the
// begining and ending keyboard frame in screen coordinates. Use the various UIView and
// UIWindow convertRect facilities to get the frame in the desired coordinate system.
// Animation key/value pairs are only available for the "will" family of notification.
UIKIT_EXTERN NSString *const UIKeyboardWillShowNotification;
UIKIT_EXTERN NSString *const UIKeyboardDidShowNotification;
UIKIT_EXTERN NSString *const UIKeyboardWillHideNotification;
UIKIT_EXTERN NSString *const UIKeyboardDidHideNotification;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@(keyboardDidDisappear)
name:UIKeyboardDidHideNotification
object:nil];