Set Content Offset for Scroll View

29,918

Solution 1

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];
}

Solution 2

Yes,

scrollView.contentOffset

Documentation: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html

Share:
29,918
Whatever Kitchen
Author by

Whatever Kitchen

Me is me... you is you?

Updated on September 04, 2020

Comments

  • Whatever Kitchen
    Whatever Kitchen over 3 years

    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.