Reputation: 141
I have a LinearLayout inside a scrollview, When i add new content to the LinearLayout scrollview scrolls to that content and then jumps back to top. How do i prevent this i.e. I want the scrollview to stay at the current position irrespective of addition or removal of new content. I've tried
Upvotes: 3
Views: 830
Reputation: 3552
You can get the OnSizeChanged
events of the LinearLayout
by making your own LinearLayout and overriding protected void onSizeChanged
. Determine the difference in oldh and h, and then scrollview.setScrollY
to compensate for the difference.
Upvotes: 3