Is there a way to set the offset of a scroll view that is inside a view controller programatically?
I have to set it based on different conditions.
yes you can set the contentOffset of your scrollview- And the code will be like this -
if(your Condition)
{
[scrollView setContentOffset:CGPointMake(0,-50) animated:YES];
}
Yes,
scrollView.contentOffset
Documentation: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html
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