5

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

Gratzi
  • 4,407
  • 12
  • 40
  • 57

2 Answers2

4

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?

Community
  • 1
  • 1
Sofi Software LLC
  • 3,516
  • 1
  • 31
  • 31
0

You can use:

setVisibility(View.GONE);

see setVisibility for details

Feel free to ask

coffee
  • 2,878
  • 4
  • 27
  • 46
  • I think you're answering for another question. – Gratzi Jul 08 '11 at 14:43
  • 1
    Let's say that I have a scroll view with 100 views, but maximum 4 views are visible at a certain moment. To see other views you have to scroll, right? Well, I would like the scroll view to be scrolled, when the, activity is displayde, to a specific view (89, for exxample). It has nothing to do with the setVisibility method. – Gratzi Jul 11 '11 at 06:39
  • ok! Thanks for the comment. Did you try [requestFocus](http://developer.android.com/reference/android/view/View.html#requestFocus%28%29)? – coffee Jul 11 '11 at 12:25