0 votes
1 view
in Java by (10.2k points)
Is there any way to scroll a ScrollView programmatically to a certain position?

I have created dynamic TableLayout which is placed in a ScrollView. So I want that on a specific action (like clicking a Button, etc.) the particular row should scroll automatically to a top position.

Is it possible?

1 Answer

0 votes
by (46.1k points)

Try:

ScrollView sv = (ScrollView)findViewById(R.id.scrl);

sv.scrollTo(0, sv.getBottom());

or

sv.scrollTo(5, 10);

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...