Synchronize all the ListView in a ViewPager

前端 未结 3 492
情书的邮戳
情书的邮戳 2020-12-14 05:01

In my application I have a ViewPager with each one a custom ListView in it linked toghether like row in a table. The problem is that when I scroll a ListView in the first pa

3条回答
  •  粉色の甜心
    2020-12-14 05:40

    Are the listview item heights equal? if so, you could pass the position of the top visible element to the other listview adapters.

     int curTop=listview.getFirstVisiblePosition();
    
     listview2.setSelection(curTop);
    

提交回复
热议问题