Reputation: 1435
How can I find if the webview has been scrolled till the top or till the last?
What checks do I need to keep on scroll offset for these two cases and which function/ delegate menthod, do I need to check it so that I know that the user has scrolled till the end or till the top?
Actually I have to change the frame of UIWebview and other views in my screen for this purpose.
Upvotes: 1
Views: 583
Reputation: 9441
Take a look at the UIScrollViewDelegate
.
Update
Here's an example:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
float scrollViewHeight = scrollView.frame.size.height;
float scrollContentSizeHeight = scrollView.contentSize.height;
float scrollOffset = scrollView.contentOffset.y;
if (scrollOffset == 0)
{
// then we are at the top
}
else if (scrollOffset + scrollViewHeight == scrollContentSizeHeight)
{
// then we are at the end
}
}
Upvotes: 1