I have a linear layout with about 20 buttons. I want to be able to change the button’s position to the top of the screen when clicked. for example. the user clicks button # 7 i want the layout to scroll automatically so button #7 is on the top position of the screen.
please help out with some code
Thanks for Viewing
Place your
LinearLayoutin aScrollViewGrab a reference to your
ScrollViewthen in theonClickof the buttons usehttp://developer.android.com/reference/android/widget/ScrollView.html#smoothScrollTo(int, int)
to scroll to the desired location.