简体   繁体   中英

Display view in a scroll view on screen

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.

Thanks a lot, Gratzi

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?

You can use:

setVisibility(View.GONE);

see setVisibility for details

Feel free to ask

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM