0

In my project i am having scrollview.when i drag a image it will add some content inside the scrollview. Likewise i can add many times by wish.when the content of scrollview increase it will update the content size.

But i want the scrollview to focus last added content in the scroll. how to do that?please help me with some code.

1 Answers1

3

Please be more clear, do you want to be able to scroll to the last added element? If so,

CGPoint bottomOffset = CGPointMake(0, scrollView.contentSize.height - scrollView.bounds.size.height);
[scrollView setContentOffset:bottomOffset animated:YES];
Premsuraj
  • 2,466
  • 1
  • 15
  • 16