一番下のセルが画面内に表示されるようにしたい場合、次のように実現できます。
- (void)viewWillAppear:(BOOL)animated {
int section = [_tableView numberOfSections] - 1;
int row = [_tableView numberOfRowsInSection:section] - 1;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];
[_tableView scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionBottom
animated:NO];
}
0 件のコメント:
コメントを投稿