2

In my layout, I have two items; an ImageView and a ListView, the ImageView appears on top of the ListView in a LinearLayout. The ImageView displays a logo or a profile image while the ListView displays a list of personal / company info.

Now this is my problem, the ListView scrolls on it's own with the ImageView fixed at the top but I want the ImageView to scroll with the ListView so that it is not fixed statically on top.

How do I do this? Is this possible? And if yes can I see an example. Thanks. :)

Edit: I have considered removing the scroll from the ListView and simply just displaying the items without scroll then I can wrap both the ImageView and ListView inside a ScrollView. However I do not know if this is possible or how I can implement it.

user3718908x100
  • 7,939
  • 15
  • 64
  • 123

1 Answers1

0

Take NestedScrollView as you parent layout and add a LinearLayout as it's child and add your ImageView and listView as child to this linear layout .

    <NestedScrollView>
<LinearLayout>
<ImageView/>
<ListView/>
</LinearLayout>
 </NestedScrollView>
Muhib Pirani
  • 765
  • 1
  • 6
  • 15