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 ie I want the scrollview to stay at the current position irrespective of addition or removal of new content. I've tried
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.
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.