I would like to know if it is possible for me to scroll through the UIScrollView when I click UIButton, and if so, can someone tell me how to do this.
I am currently using the code below to see if there is more content in the scroll to the left of it, and if there is one, display an image that will tell users that there is more content if they scroll to the left. I would like to implement functionality where I add a UIButton instead of an image, and when more content is available on the left, and when the user clicks a button, the scroll scrolls to the left.
- (void)scrollViewDidScroll:(UIScrollView *)scrollView1 {
if (scrollView1.contentOffset.x == scrollView1.contentSize.width - scrollView1.frame.size.width)
{
self.imageView.hidden = YES;
}
else
{
self.imageView.hidden = NO;
}
}
It would be great if someone could help me with this.
source
share