键盘弹出和回收通知

版权声明:青干欧阳技术博客 https://blog.csdn.net/qq_40598646/article/details/80689248
[[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);
}

阅读更多
想对作者说点什么?

博主推荐

换一批

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