how to scroll table on the click event of some cell in objective c?

Posted by Sarah on Stack Overflow See other posts from Stack Overflow or by Sarah
Published on 2011-01-01T07:40:49Z Indexed on 2011/01/01 7:54 UTC
Read the original article Hit count: 261

Filed under:
|

Hello friends,

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.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about uitableview