James Brown
James Brown

Reputation: 919

UITextView Scrolling Issue

I have an iOS 5.1 project in Xcode, and I have a view controller that, when you swipe left and right, changes the information on the screen VIA UITextView. I reuse the same view controller and the problem I am having is that when you scroll down and read the text and then swipe left, the scroll position doesn't reset to the top. Is there a function I can call that will reset scroll position?

ANSWER:

Found that this was what I was looking for:

[self.textView scrollRectToVisible:CGRectMake(0,0,1,1) animated:NO];

Upvotes: 2

Views: 1468

Answers (1)

DarkByte
DarkByte

Reputation: 1176

Try this.

[self.textView setContentOffset:CGPointMake(0, 0) animated:NO];

Hope it helps !

Upvotes: 3

Related Questions