1

I want to scroll a parent container having linear layout and listview as its child layouts. The problem is that ListView scroll doesnt work inside ScrollView, i have tried this but didnt work.

Android list view inside a scroll view


I want to make it look like as if the "simple layout" is ListView's 0th item. So simple layout scroll with the listview rows. I think its doable by using different layouts inside getView in List Adapter but simple layout will going to have 2 dropdowns and button which will be used to control the below list just like a filter. So i think its not a good idea to do this as all the click handlers for dropdown and button will be inside getView.

two layouts inside once scrollable container

Community
  • 1
  • 1
TaLha Khan
  • 2,413
  • 2
  • 25
  • 39

2 Answers2

3
  • You Can use ListView HeaderView As mentioned above,

  • Also You can put them both ( ListView & Simple Layout ) inside a parent LinearLayout Then include the parent LinearLayout inside a parent ScrollView

Kazaky
  • 41
  • 1
  • 4
1

In my opinion, you are not approaching it right. All you want to do is to add a header to the list.

This can be done easily by the ListView object itself. Try this: How to use addHeaderView to add a simple ImageView to a ListView

Community
  • 1
  • 1
A-S
  • 2,547
  • 2
  • 27
  • 37