matghazaryan
matghazaryan

Reputation: 5896

listView advice

I want create listview without layout_height. I mean if there is 100 item in listview, no need to create scrolling. it just have to take place so many height as it need. Is there a way to do this? Anytime I add items the listView height should increase but no need scrolling.

Upvotes: 0

Views: 76

Answers (1)

Thommy
Thommy

Reputation: 5417

You have to do this programatically: After knowing how many entries you got you have to manuallay set the layout_height in Java code to (getWindowManager().getDefaultDisplay().getHeight() / number_of_entries). But I still don't get why you want to do that. If you got 100 entries on a Nexus S you got 8 Pixel for each entry. Way to less to read or klick them precicely.

Upvotes: 1

Related Questions