Speed Demon
Speed Demon

Reputation: 691

Issue using another ListView as header in my current ListView in Android

I thought I would have trouble adding a ListView as a header to an existing ListView because both have scroller container. But that part works fine, the header ListView gets automatically scrolled with the parent ListView.

The only issue I have is that the ListView in the header always shows just one element even though its adapter dataset contains more than one element. I tried setting its layout parameters (height to WRAP_CONTENT) programatically but I couldn't fix this.

Does anyone have an idea what is causing this behavior (only one visible element from the header list) ?

Upvotes: 0

Views: 67

Answers (1)

Keyfe Ang
Keyfe Ang

Reputation: 386

Wrap content height does't work on list view. If you want. Try to set fix height for your listview(header). And keep in mind, nested listview maybe a bad idea.

Related issue from here i guess as per K_anas.

Upvotes: 1

Related Questions