0

I want to put tow listviews in one scrollview on android platfrom to make both of them scrolling synchronized. For instance, when I drag the left listview up and down, the right side one would be scrolled as the same. I have tried to extend the scrollview for overriding methods but haven't get it work. Any advice will be appreciated.

1 Answer 1

0

If your two listview does not take many memory and has same height, try put them in single scrollview and let scrollview do scroll.

layout would be look like this:

<scrollview layout_width:fill_parent layout_height:wrap_content>
    <linearlayout orientation:horizontal layout_height:wrap_content layout_width:fill_parent>
         <listview layout_height:wrap_content layout_width:wrap_content layout_weight:1/>
         <listview layout_height:wrap_content layout_width:wrap_content layout_weight:1/>
    </linearlayout>
</scrollview>

In this case, you should set height of listview manually. you can find a solution here.

But if you use this solution, listview can't optimize memory usage, so listview can take much memory as item count increase.

1
  • Thank you for your advice. Actually, I have checked out that thread before which you cliped in here. I'm about to give setting the listview layout params in adapter a shot.
    – Marshall
    Oct 19, 2011 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.