UIScrollView's core has 2 properties which manage the visible portions of the scroll view on the screen.
- When we set contentSize
- When we set contentSize
- if the contentOffset is beyond the new contentSize the contentOffset is reset.
- else the contentOffset is not changed.
If you want to animate the contentOffset in the case when your contentOffset goes beyond contentSize then:
[[UIView animateWithDuration:0.2
animations:^{
animations:^{
self.contentSize = CGSizeMake(self.scrollViews.count * self.bounds.size.width, self.bounds.size.height);
}
completion:NULL];
completion:NULL];
Nice post . Thanks for share.
ReplyDeleteIf you love gaming for unity games kindly visit….
mobile app & game development