Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ipad 如何检测我们是否以编程方式关闭键盘,并通过在uitextview中点击键盘关闭键盘?_Ipad_Keyboard_Uitextview_Ios5 - Fatal编程技术网

Ipad 如何检测我们是否以编程方式关闭键盘,并通过在uitextview中点击键盘关闭键盘?

Ipad 如何检测我们是否以编程方式关闭键盘,并通过在uitextview中点击键盘关闭键盘?,ipad,keyboard,uitextview,ios5,Ipad,Keyboard,Uitextview,Ios5,我需要得到这些信息,如何检测我们是否以编程方式关闭键盘,并通过在uitextview中点击键盘关闭键盘?他们两个都打电话来了 -(BOOL)textViewShouldEndEditing:(UITextView *)textView 但是如何检测它的差异呢?有人能给我一些线索吗?您可以创建一个通知观察者并监听某些事件: 窗口类 例子 您好@Wrightsc我已经试过了,他们两个仍然调用所有通知,您能告诉我另一个线索吗?我只是想知道,如果我们使用uitextview按钮中的“取消锁定/拆分”(

我需要得到这些信息,如何检测我们是否以编程方式关闭键盘,并通过在uitextview中点击键盘关闭键盘?他们两个都打电话来了

-(BOOL)textViewShouldEndEditing:(UITextView *)textView

但是如何检测它的差异呢?有人能给我一些线索吗?

您可以创建一个通知观察者并监听某些事件:

窗口类 例子
您好@Wrightsc我已经试过了,他们两个仍然调用所有通知,您能告诉我另一个线索吗?我只是想知道,如果我们使用uitextview按钮中的“取消锁定/拆分”(取消锁定)按钮取消屏幕上的键盘,会触发什么方法/事件使用我在示例中使用的通知。当键盘关闭时,您可以使用一个名为“
keyboardiddefine
”的方法来完成需要执行的操作
// 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];