Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display view in a scroll view on screen

Tags:

android

In my activity I have a scroll view which contains a linear layout that has many views. Is there a way I can display a specific view (from the linear layout) when starting this activity? By default this view is hidden, so I must scroll the scroll view to make it visible.

like image 871
Gratzi Avatar asked Oct 11 '22 13:10

Gratzi


1 Answers

Scroll the view to the view you want to show:

scrollView.smoothScrollTo(0, specificView.getTop())

See Is there a way to programmatically scroll a scroll view to a specific edit text?

like image 167
Sofi Software LLC Avatar answered Oct 15 '22 09:10

Sofi Software LLC