UIScrollview shifting contents up after scrolling down and pushing new viewcontroler

ios, objective-c, uiscrollview

Solution

I solved the problem

-(void)viewWillAppear:(BOOL)animated{

     [scroll setContentOffset:CGPointMake(0,0)];

}

Problem

I have trouble figuring out this issue on my uiscrollview. The contents inside my uiscrollview move up after clicking a button to push a new view controller onto the screen, and then going back to the original view controller. Notice how the the top of the scrollview changes. Here is the code for the scrollView ``` - (void)viewDidLoad{ [super viewDidLoad]; [scroll setScrollEnabled:YES]; [scroll setContentSize:CGSizeMake(923, 934)]; [self.view addSubview:scroll]; } ```

Original source