爱程序网

//视图跟着键盘推出一起动

来源: 阅读:

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardwasChange:) name:UIKeyboardWillChangeFrameNotification object:nil];

 

- (void)keyboardwasChange:(NSNotification *)info

{

    CGRect keyFrame = [info.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];

    CGFloat tY = keyFrame.origin.y - self.view.frame.size.height - 64;

    

    self.view.transform = CGAffineTransformMakeTranslation(0, tY);

}

关于爱程序网 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助