I have made an app with a Registration form. When the Textfield in this form is selected it gets hidden by the soft keyboard. If i leave it as it is user can't see what he is entering while typing.
Textfields is hiding by the Keypad
98 Views Asked by AudioBubble At
2
There are 2 best solutions below
4

Try this may be helpfull..
- (void)textFieldDidBeginEditing:(UITextField *)textField{
[self animateTextField:textField up:YES];
}
- (void)textFieldDidEndEditing:(UITextField *)textField{
[self animateTextField:textField up:NO];}
-(void)animateTextField:(UITextField*)textField up:(BOOL)up
{
int movementDistance = -100; // tweak as needed
float movementDuration = 0.3f; // tweak as needed
int movement = (up ? movementDistance : -movementDistance);
[UIView beginAnimations: @"animateTextField" context: nil];
[UIView setAnimationBeginsFromCurrentState: YES];
[UIView setAnimationDuration: movementDuration];
self.view.frame = CGRectOffset(self.view.frame, 0, movement);
[UIView commitAnimations];
}
this is the old method ,but working fine for each time
in your .h file
.m file