青干欧阳的博客

码农的历程

键盘弹出和回收通知

[[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
想对作者说点什么? 我来说一句

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

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭