通过滚动同步2个ListView

ark*_*tal 5 android listview scroll android-listview

可能重复:
如何在滚动时同步两个Listview位置
同步2 ListView

我有两个ListViews.当我滚动列表中的任何一个时,有什么方法可以找到它synchronize的位置ListViews.我正在实施一个AbsListView.OnScrollListener,注册到ListView.

ListView滚动时,将触发onScroll()方法OnScrollListener,然后我调用smoothScrollToPosition().但它不能正常工作.

有人可以为我提供任何代码示例吗?...我只想要Scroll One ListView和其他ListView同步动作.如果你想知道为什么我使用2 ListView是因为我正在尝试制作我自己的复合控件,其行为DataGridView与列固定和标题

Iai*_*n_b 1

尝试类似的东西

if( this.getScrollY() != otherList.getScrollY() )
    otherList.setScrollY( this.getScrollY() );
Run Code Online (Sandbox Code Playgroud)

在onScrollListener的onScroll方法中。上面的内容相当粗糙。