You must move your view when the keyboard appears. The code:
In the .m file
- (void) loginViewUp : (UIView*) view { if(!alreadyViewUp) { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; CGRect rect = view.frame; rect.origin.y -= View_Move_Hight; view.frame = rect; [UIView commitAnimations]; alreadyViewUp = !alreadyViewUp; } } - (void) loginViewDown :(UIView*) view { if(alreadyViewUp) { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; CGRect rect = view.frame; rect.origin.y += View_Move_Hight; view.frame = rect; [UIView commitAnimations]; alreadyViewUp = !alreadyViewUp; } }
In the .h file
- (void) loginViewUp : (UIView*) view;
here
#define View_Move_Hight 170
defined before @implementation .
source share