(void) Viewwillappear: (BOOL) animated
{
[[ nsnotificationcenter defaultcenter" addobserver : self selector : @selector (keyboardwillshow:) name: uikeyboardwillshownotification object : nil ];
[[nsnotificationcenterdefaultcenter]addobserver: Self selector:@selector(keyboardwillhide:)name: Uikeyboardwillhidenotificationobject:nil];
}
-(void) Keyboardwillshow: (nsnotification *) Noti
{
// get keyboard size
CGRect keyboardbounds;
[[Noti. UserInfovalueforkeypath:uikeyboardframeenduserinfokey]getValue :&keyboardbounds];
CGRect frame;
if (version<7.0) {
frame =CGRectMake(0,0, mainheight,mainheight-);
}Else{
frame =CGRectMake(0,0, mainheight,mainheight);;
}
[UIViewbeginanimations:nilcontext:NULL ];
[UIViewsetanimationbeginsfromcurrentstate:YES];
[UIViewsetanimationduration:0.3f];
if (mainheight<) {
Frame. Origin. y -=;
}Else {
Frame. Origin. y -=;
}
_backview. frame = frame;
[UIViewcommitanimations];
}
-(void) Keyboardwillhide: (nsnotification *) Noti
{
// get keyboard size
CGRect keyboardbounds;
[[Noti. UserInfovalueforkeypath:uikeyboardframeenduserinfokey]getValue :&keyboardbounds];
CGRect frame;
if (version<7.0) {
frame =CGRectMake(0,0, mainheight,mainheight-);
}Else{
frame =CGRectMake(0,0, mainheight,mainheight);;
}
[UIViewbeginanimations:nilcontext:NULL ];
[UIViewsetanimationbeginsfromcurrentstate:YES];
[UIViewsetanimationduration:0.3f];
_backview. frame = frame;
[UIViewcommitanimations];
}
Keyboard view decreases with keyboard elevation