Vaibs
Vaibs

Reputation: 1138

how to Expand and collapse listview on click of button?

I have a listview in my fragment which occupies around 25% of my screen size. I also have a stripdown button. So, I want that when a strip down is clicked, that that time list view should expand and cover around 50% of the screen size and then again when i click stripUp it should return to it's former state. Can you please suggest some techniques through which i can achieve this.

My listview is like this: say i have 25 elements then initially only 10 of them are visible and to see others i will scroll down in Listview. After that when i click on stripDown button then number of visible items will increase to 15 and to see other elements i will scroll down.

Thanks in advance.

Upvotes: 1

Views: 2958

Answers (1)

Ragunath Jawahar
Ragunath Jawahar

Reputation: 19723

Try the ListView section on the Api demo prior to honey comb. There are several examples that depict the usage of ListViews. It also includes an ExpandableListView and a regular ListView with an expandable effect.

You can find the demos from you Android SDK installation on your machine.

android-sdk/samples/android-x/ApiDemos

Upvotes: 1

Related Questions