mat
mat

Reputation: 11

How to make scroll view reposition back to the top when I click a button

Hi I have a image in a view controller that has a scroll view, when the user scrolls to the bottom, there is a button that they click and it hides the view they were looking at and loads another, but it stays at the bottom because of the scroll view, so how can I go about reseting the scroll view back to the top when you click that button?

Upvotes: 1

Views: 1862

Answers (1)

Gypsa
Gypsa

Reputation: 11314

on your button click do

[self.scrollView setContentOffset:CGPointMake(0, 0)];

scrollView is the scroll view object.Replace it with your scroll view object name.

Upvotes: 4

Related Questions