Ios ipad如何知道键盘被隐藏了
我正在构建一个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
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
{
}