I need to show/hide four textviews on pressing four buttons. The functionality is visible in pictures. In iOS I used button. But for android,can I use some sort of list view or something else suitable to thisenter image description here?
!First and second buttons are pressed here while third and fourth are not yet. Again pressing the button that is already pressed,text hides]1
Asked
Active
Viewed 798 times
0

Ali Hassan
- 519
- 6
- 26
-
you can do it like in iOS using button + textview below button.. also to show hide element in android check tag visibility.. – Marko Niciforovic Dec 13 '13 at 07:32
-
1What you are looking for is an expandable list view. Some resources: http://stackoverflow.com/a/9834782/827110 – Amulya Khare Dec 13 '13 at 07:33
2 Answers
3
You can use ExpandableListView.
Using ExpandableListView, you can have groups and childs, and you can expand and collapse any groups you want.
For example:
mExpandableListView.expandGroup(groupPosition);
mExpandableListView.collapseGroup(groupPosition);

Paresh Mayani
- 127,700
- 71
- 241
- 295
-
I ve checked examples for expandablelistview, they all show single word or one line text,not a textview for multiple lines, is there a good tutorial for that? – Ali Hassan Dec 13 '13 at 08:05
-
1
These is a very good example on Custom ExpandibleList
in Github.
https://github.com/tjerkw/Android-SlideExpandableListView
Hope this will help you to achieve smooth animation and collapse
.
You need to change the layout as your requirement.
Hope this will help you.

Amit Gupta
- 8,914
- 1
- 25
- 33