I have UIScrollView on which I am using 2 UIButtons. UIScrollView initial frame is (0,0,768,1024). I want when I click on first button the UIScrollView y-cordinate position will be 500, means it will scrolldown 500 positions below to its actual position.
And when I click second Button which Will show on UIScrollView, Position Y-cordinate of UIScrollView y=535, then UIScrollView Move up to Position y= 0 again.
First button click UIScrollView y = 500 Second button click UIScrollView y = 0
Any hints from experts would be very welcome.
Maybe you do not want to change the frame
of the scroll view (this would just displace the whole view), but the contentOffset
. This can be animated, too.
CGPoint offset = scrollView.contentOffset;
offset.y += 500;
[scrollView setContentOffset:offset animated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With