键盘弹出和回收通知

[[NSNotificationCenterdefaultCenteraddObserver:selfselector:@selector(jianpantanchu:) name:UIKeyboardWillShowNotificationobject:nil];
    [[NSNotificationCenterdefaultCenteraddObserver:selfselector:@selector(jianpanhuishou:) name:UIKeyboardWillHideNotificationobject:nil];

//键盘弹出
- (void)jianpantanchu:(NSNotification*)notification
{
    NSDictionary*info = notification.userInfo;
    NSValue*value = [info objectForKey:UIKeyboardFrameEndUserInfoKey];
    CGSizesize = [value CGRectValue].size;
    _backview.frameCGRectMake(0SCREEN_HEIGHTSTA_NAV_HEIGHT35*displayScale- size.heightSCREEN_WIDTH35*displayScale);
    
}

//键盘回收
- (void)jianpanhuishou:(NSNotification*)notification
{
    _backview.frameCGRectMake(0SCREEN_HEIGHTSTA_NAV_HEIGHT35*displayScaleSCREEN_WIDTH35*displayScale);
}

阅读更多
版权声明:青干欧阳技术博客 https://blog.csdn.net/qq_40598646/article/details/80689248
上一篇XIB 使用 runtime添加button 的cornerRadius,borderWidth,borderColor属性
下一篇获取系统剩余内存大小
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭