Wednesday, 5 September 2012

Scroll Tableview to the Bottom in iPhone

 CGRect sectionRect = [self.tableView rectForSection: sectionIndexForNewFolder];
    // Try to get a full-height rect which is centred on the sectionRect
    // This produces a very similar effect to UITableViewScrollPositionMiddle.
    CGFloat extraHeightToAdd = sectionRect.size.height - self.tableView.frame.size.height;
    sectionRect.origin.y -= extraHeightToAdd * 0.5f;
    sectionRect.size.height += extraHeightToAdd;
    [self.tableView scrollRectToVisible:sectionRect animated:YES];

No comments:

Post a Comment