ユーザーがUITableViewの一番下までスクロールしているかどうかを検出しようとしています。適切に物を計算するために、私はUITableViewの可視rectを取得する必要があります。どうすればこれを達成できますか?UITableViewの可視のrectを取得するにはどうすればよいですか?
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
[_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView];
int currentMaxPosition = CGRectGetMaxY([self.tableView visibleRect]);
int currentMinPosition = CGRectGetMinY([self.tableView visibleRect]);
int tableViewBottom = [self.tableView bounds].size.height - 100;
int tableViewTop = 0;
//get older messages once we're near the bottom
if (currentMaxPosition > tableViewBottom - 100)
{
NSLog(@"WE AT THE BOTTOM!");
}
}
visiblecellに基づいて、ユーザーが最下位にいるかどうかをどのように判断するのですか? –
' - (NSArray *)indexPathsForVisibleRows'を使用して、これらの行のインデックスパスを取得します。 –