1

I have a tableView with a lot of field, like a form. The question is that when the user is changing to the next row, if the row is bellow the keyboard, the user does not see the label nor the text his writing.

I have try to use:

NSIndexPath *path = [NSIndexPath indexPathForRow:indexPath.row + 1 inSection:indexPath.section];

[self.theTable scrollToRowAtIndexPath:path atScrollPosition:UITableViewScrollPositionTop animated:YES];

but without success.

Let me tell you that the viewController is controlling a view, with a table inside it. The table is not the view itself.

How can I make the cell becomes visible, so that the user can see, even if that's the last row of the table (has about 20 rows)?

Deepak Danduprolu
  • 44,595
  • 12
  • 101
  • 105
Rui Lopes
  • 2,562
  • 6
  • 34
  • 49

2 Answers2

0

Either use a subclass of UITableViewController (which already handles this automatically) or resize your table view when the keyboard becomes visible, so that it's not behind the keyboard. You can also use the contentInset property instead of changing the table view's frame.

To be notified when the keyboard shows or hides, listen for UIKeyboardWillShowNotification and UIKeyboardWillHideNotification.

omz
  • 53,243
  • 5
  • 129
  • 141
0

For handling the keyboard yourself look at this answer resize UIView when showing the keyboard for iphone, how to?

Community
  • 1
  • 1
Cyprian
  • 9,423
  • 4
  • 39
  • 73