I scrollView will scroll an entire screen in addition to its content. How does the scrollView know long to be? I want to change the maximum scrollable/content height of my scrollView. So I try looking at the source code, but I am not successful yet. Thanks for any help.
Asked
Active
Viewed 63 times
0
-
You set the scroll view to a fixed size. The element inside of the scroll view can then be scrolled depending on its size. Scroll view itself doesn't change size. – Ivan Skoric Oct 24 '14 at 23:51
-
@androbat come on, man, read the question: **maximum scrollable/content height**. I am not talking about the layout_height. I am talking about scrollable height: maxScrollableHeight – Katedral Pillon Oct 24 '14 at 23:57
-
Your scroll view can only have one child, for example LinearLayout. So if you want your scrollable content height to be lets say 2000dp max, you can set in that LinearLayout android:maxHeight="2000dp". Does that help? – Ivan Skoric Oct 25 '14 at 00:00
-
@androbat that was a good idea. But it does not work somehow. For some reason the scrollView itself will scroll beyond the LinearLayout. I am trying to get the scroll to stop exactly when the content stops. You see how a ListView will stop with the last row? The scrollView needs to do that, but it's not doing that. – Katedral Pillon Oct 25 '14 at 00:10
-
Set in the LinearLayout: android:layout_height="wrap_content" and for example android:maxHeight="2000dp" or whatever the max you want – Ivan Skoric Oct 25 '14 at 00:14
-
@androbat thanks! I use your suggestions to find a solution. I set each of the children of the ListView to fix sizes instead of wrap_content. And that was it. – Katedral Pillon Oct 25 '14 at 01:11
-
actually that solution only works on Galaxy S5. It does not work on my LG api 16 for example. – Katedral Pillon Oct 25 '14 at 01:19
-
what exactly do you need? your question seems to be ambiguous... – pskink Oct 25 '14 at 07:09
-
@pskink what I need is already asked http://stackoverflow.com/questions/26556307/how-to-remove-white-space-showing-on-top-of-scrollview but there is no answer yet, so I ask it differently here. – Katedral Pillon Oct 25 '14 at 09:50