First implement the setup agent, Self.textfield. delegate = self;
Specific implementation code:-(void) textfielddidbeginediting: (Uitextfield *) textfield{nstimeinterval animationduration = 0.30f; [UIView beginanimations:@ "Resizeforkeyboard" context:nil]; [UIView setanimationduration:animationduration]; if ([UIScreen mainscreen].bounds.size.width>320) {//] move the y-coordinate of the view up so that the space below is used for the display of the soft keyboard self.view.frame = Cgrec Tmake (0.0f, -200.0f, Self.view.frame.size.width, self.view.frame.size.height);//64-216 [UIView commitanimations]; } else{self.view.frame = CGRectMake (0.0f, -170.0f, Self.view.frame.size.width, self.view.frame.size.height); [UIView commitanimations]; }}-(void) textfielddidendediting: (Uitextfield *) textfield{//sliding effect nstimeinterval animationduration = 0.30f; [UIView beginanimations:@ "Resizeforkeyboard" context:nil]; [UIView setanimationduration:animationduration]; Recovery screen self.view.frame = CGRectMake (0.0f, 0.0f, Self.view.frame.size.width, self.view.frame.size.height);//64-216 [UIView CommItanimations];}
iOS with TextField viewcontroller changes position as the keyboard bounces