Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.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
Ios ipad如何知道键盘被隐藏了_Ios_Ipad_Keyboard_Hide - Fatal编程技术网

Ios ipad如何知道键盘被隐藏了

Ios ipad如何知道键盘被隐藏了,ios,ipad,keyboard,hide,Ios,Ipad,Keyboard,Hide,我正在构建一个ipad应用程序 它有一些文本字段,点击时会移动到键盘上方 NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; [center addObserver:self selector:@selector(didShow) name:UIKeyboardDidShowNotification object:nil]; [center addObserver:self selector:@selector

我正在构建一个ipad应用程序

它有一些文本字段,点击时会移动到键盘上方

NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(didShow) name:UIKeyboardDidShowNotification object:nil];
[center addObserver:self selector:@selector(didHide) name:UIKeyboardWillHideNotification object:nil];

//Resize your views in the below methods
- (void)didShow
{

}

- (void)didHide
{

}
如果点击“计算”按钮,键盘和视图将向下

但如果用户在ipad上点击隐藏键盘[键盘右下角键]

我的视野仍然很高

那么,我如何通过编程知道“隐藏键盘”已被点击


非常感谢

您应该使用通知中心来跟踪键盘

NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(didShow) name:UIKeyboardDidShowNotification object:nil];
[center addObserver:self selector:@selector(didHide) name:UIKeyboardWillHideNotification object:nil];

//Resize your views in the below methods
- (void)didShow
{

}

- (void)didHide
{

}