Balkrishna Rawool
Balkrishna Rawool

Reputation: 1863

Set content offset of ScrollView

I am using a ScrollView which has multiple LinearLayouts and more LinearLayouts get added as I scroll down to the end. I got this implementation from an answer to this question

It works fine. But now the problem is when I reach the bottom of the ScrollView, it loads more contents and as I was scrolling just before new content got added, the ScrollView scrolls down further. I do not want this as it skips some of the things from my sight that I have not seen yet. What I want is that the ScrollView stops scrolling just before it loads more content. I suppose this can be achieved by setting the content offset of ScrollView. But I'm not able to find a way to do that. Thanks in advance.

Upvotes: 1

Views: 5054

Answers (1)

Balkrishna Rawool
Balkrishna Rawool

Reputation: 1863

It was so obvious but I overlooked it.. ScrollView.scrollTo(int x, int y)

Upvotes: 5

Related Questions