1

I have a form that the user of the app must fill in order to register to the service. However, as there are many fields that need to be filled, some of them are at the bottom of the screen, so when the keyboard appears, the field is covered and the user can't see what's typed.

I'm using a UITableView with custom Prototype Cells, each one has a UITextField named textField.

Girish
  • 4,692
  • 4
  • 35
  • 55
Oscar Swanros
  • 19,767
  • 5
  • 32
  • 48

3 Answers3

1

There are a lot of solutions to your problem. You can use this. There's a sample code which handles the keyboard animation for UITableView as well.

Rushi
  • 4,553
  • 4
  • 33
  • 46
0

you move table up when user start typing.

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
[UIView beginAnimations:nil context:self.tableView];
            [UIView setAnimationDuration:0.25];
             [self.view setFrame:CGRectMake(0, -130, 320, 460)];
            [UIView commitAnimations];
return YES;
}
Nims
  • 431
  • 6
  • 15
0

Hi try this code hope will help

-(void)textFieldDidBeginEditing:(UITextField *)textField
{

  UITableViewCell *newcell = (UITableViewCell*) [[textField superview] superview];

    [tbl_view scrollToRowAtIndexPath:[tbl_view indexPathForCell:newcell] atScrollPosition:UITableViewScrollPositionTop animated:YES];

}
Sugan S
  • 1,782
  • 7
  • 25
  • 47