-(Bool) textfieldshouldreturn :( uitextfield *) textfield {// when the user presses return, take focus away from the text field so that the keyboard is dismissed. nstimeinterval animationduration = 0.30f; [uiview Duration: @ "resizeforkeyboard" context: Nil]; [uiview Duration: animationduration]; cgrect rect = cgrectmake (0.0f, 0.0f, self. frame. size. width, self. frame. size. height); self. frame = rect; [uiview commitanimations]; [textfield resignfirstresponder]; return YES ;}# define move_height 80-(void) Comment :( uitextfield *) textfield {cgrect frame = textfield. frame; int offset = frame. origin. Y + move_height-(self. frame. size. height-216.0); // keyboard height 216 nstimeinterval animationduration = 0.30f; [uiview Duration: @ "resizeforkeyboard" context: Nil]; [uiview setanimationduration: animationduration]; float width = self. frame. size. width; float Height = self. frame. size. height; If (Offset> 0) {cgrect rect = cgrectmake (0.0f,-offset, width, height); self. frame = rect;} [uiview commitanimations];}