1

I am right now working with one application where i need to take one uitableview with uilable and textfield in each cell.I am able to scroll the table manually once the user starts writing, but what i want is that when i click on the textfield,the table should scroll upward so that the user is able to see what he has entered in the textfield.Same thing i saw once i logged in the iphone facebook.

this is the code for manually scrolling the table :

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 250;
}

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    CGRect viewRect    = CGRectMake(0, 0, 320, 160);
    UIView *footerView = [[UIView alloc] initWithFrame:viewRect];
    return footerView;
}

Is there any way around?

Thanks in advance.

Yama
  • 2,649
  • 3
  • 31
  • 63

2 Answers2

1

This post describes what you want to achieve. Also see this tutorial which nicely describes how to solve this problem.

Happy coding & happy new year

Community
  • 1
  • 1
raaz
  • 12,410
  • 22
  • 64
  • 81
0

Actually, table view should scroll up when keyboard appears automatically (when text field is placed on table view, and when table is controlled by tableViewController).

Nickolay Olshevsky
  • 13,706
  • 1
  • 34
  • 48
  • Well,the keypad appears but it is not scrolling up automatically and as a result,it hides half of the part of the uitableview. Any solution?? – Yama Jan 01 '11 at 09:20