Possible Duplicate:
How to syncronisize two Listview positions
Sync 2 ListViews while Scrolling
I have two ListViews. Is there any way to synchronize the position of ListViews when I scroll any one of the Lists. I am implementing an AbsListView.OnScrollListener, registering to the ListView.
When the ListView is scrolled, the onScroll() method of OnScrollListener will be triggered, then i call smoothScrollToPosition(). But it don't work properly.
Can someone provide me any code example for this?...I Only want to Scroll One ListView and the other ListView moves synchronously. If you wan to know why i am using 2 ListView is because i am trying to make my own compound control that behaves as a DataGridView with a column fixed and headers
Try something like
if( this.getScrollY() != otherList.getScrollY() )
otherList.setScrollY( this.getScrollY() );
In the onScroll method of the onScrollListener. The above is pretty rough.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With