标签:
- (void)keyboardFrameChange:(NSNotification *)info{ 1.获取键盘最后的y值 NSDictionary *keyBoardDict = info.userInfo; CGRect keyBoardFrame = [keyBoardDict[UIKeyboardFrameEndUserInfoKey]CGRectValue]; // 2.设置view的移动的范围 CGFloat viewH = self.view.frame.size.height; CGFloat keyBoardTy = keyBoardFrame.origin.y - viewH; CGFloat duration = [keyBoardDict[UIKeyboardAnimationDurationUserInfoKey]doubleValue]; [UIView animateWithDuration:duration animations:^{ self.view.transform = CGAffineTransformMakeTranslation(0, keyBoardTy); }]; }
标签:
原文地址:http://www.cnblogs.com/gp886/p/4941240.html