2

I was wondering if it was possible to set the scroll range of the android ScrollView. Basically I have a scroll view with one child in it that extends 100 pixels past the bottom of the screen. Normally the scroll view will scroll till it gets to the bottom of the child view, is there a way to get the scroll view to stop scrolling like half way and not show the whole child view? I have tried extending ScrollView and overriding the computeVerticalScrollRange() but that did not work. Any help would be appreciated.

Thanks, Sam

Sam
  • 21
  • 2

1 Answers1

0

Do you want it to only sometimes scroll to the bottom? Or never at all? In the case of the latter, I would suggest reconsidering your layout and removing that child from the scrollview parent.

citizen conn
  • 15,300
  • 3
  • 58
  • 80
  • Only sometimes, there are children views inside the child of the scroll view that I would like to have the option to not include in the scroll range depending on the situation. I was semi able to achieve this by using this solution on child view inside the scrollview. http://stackoverflow.com/questions/2963152/android-how-to-resize-a-custom-view-programmatically. But then the children views became distorted and not scaled properly after the new size was set. – Sam Jun 23 '11 at 20:35
  • Maybe try listening for the scroll height property onScroll, and if you want it to stop at a certain point, and the scrollheight matches the topY of your child view then prevent scrolling? – citizen conn Jun 24 '11 at 18:31