The Keyboard view decreases as the keyboard increases.
(Void) viewWillAppear :( BOOL) animated
{
[[Nsnotifcencenterdefacenter] addObserver: selfselector: @ selector (keyboardWillShow :) name: UIKeyboardWillShowNotificationobject: nil];
[[Nsnotifcencenterdefacenter] addObserver: selfselector: @ selector (keyboardWillHide :) name: UIKeyboardWillHideNotificationobject: nil];
}
-(Void) keyboardWillShow :( NSNotification *) noti
{
// Obtain the keyboard size.
CGRect keyboardBounds;
[[Noti. userInfovalueForKeyPath: UIKeyboardFrameEndUserInfoKey] getValue: & keyboardBounds];
CGRect frame;
If (version <7.0 ){
Frame = CGRectMake (, mainHeight, mainHeight-20 );;
} Else {
Frame = CGRectMake (0, 0, mainHeight, mainHeight );;
}
[UIViewbeginAnimations: nilcontext: NULL];
[UIViewsetAnimationBeginsFromCurrentState: YES];
[UIViewsetAnimationDuration: 0.3f];
If (mainHeight <500 ){
Frame. origin. y-= 110;
} Else {
Frame. origin. y-= 25;
}
_ BackView. frame = frame;
[UIViewcommitAnimations];
}
-(Void) keyboardWillHide :( NSNotification *) noti
{
// Obtain the keyboard size.
CGRect keyboardBounds;
[[Noti. userInfovalueForKeyPath: UIKeyboardFrameEndUserInfoKey] getValue: & keyboardBounds];
CGRect frame;
If (version <7.0 ){
Frame = CGRectMake (, mainHeight, mainHeight-20 );;
} Else {
Frame = CGRectMake (0, 0, mainHeight, mainHeight );;
}
[UIViewbeginAnimations: nilcontext: NULL];
[UIViewsetAnimationBeginsFromCurrentState: YES];
[UIViewsetAnimationDuration: 0.3f];
_ BackView. frame = frame;
[UIViewcommitAnimations];
}