-(Void) viewdidload
{
// Create a notification listening keyboard change
[[Nsicationcenter center defacenter center] addobserver: Self selector: @ selector (keyboardwillshow :) name: uikeyboardwillchangeframenotification object: Nil];
}
# Pragma mark notification
-(Void) keyboardwillshow :( nsnotification *) Notification
{
Nsdictionary * DIC = notification. userinfo;
Cgrect rect = [[DIC objectforkey: uikeyboardframeenduserinfokey] cgrectvalue];
Float Height = rect. Size. height;
[Uiview beginanimations: Nil context: Nil];
[Uiview setanimationduration:. 25];
_ Tfview. Frame = cgrectmake (0, self. View. Frame. Size. Height-height-50, self. View. Frame. Size. Width, 50 );
_ Tableview. Frame = cgrectmake (0, 0, screen. Width, screen. Height-216-50 );
[Uiview commitanimations];
}
# Pragma mark click return to disappear the keyboard
-(Bool) textfieldshouldreturn :( uitextfield *) textfield
{
[_ TF resignfirstresponder];
[Uiview beginanimations: Nil context: Nil];
[Uiview setanimationduration: 0.25];
_ Tfview. Frame = cgrectmake (0, screen. Height-50, screen. Width, 50 );
_ Tableview. Frame = cgrectmake (0, 0, screen. Width, screen. Height-50 );
[Uiview commitanimations];
Return yes;
}
// Remove notification
Auto-adaptive keyboard height for notification listening keyboard height change