Reputation: 1121
I have 3 Buttons, 3 Scroll Views, and some Textviews and pictures and what not.
The 3 Buttons I want to be able to show a different Scroll View when they are clicked.
So clicking Button #1 would show Scroll View #1 and hide Scroll View #2 & #3
etc....
Is there a way to do this programmatically? Like in an OnClick() Event?
Upvotes: 0
Views: 1535
Reputation: 3192
Use ExpandableListview For that
Refer this Links this will help to Implement ExpandableListview in android
Upvotes: 0
Reputation: 10785
you can use the setVisiblility()
method:
mScrollView.setVisibility(View.GONE);
by setting View.GONE
you'll view will become invisible, and will not take any actual space inside the layout container it reside in.
then when you'll want to make it visible again, use the:
mScrollView.setVisibility(View.VISIBLE);
Upvotes: 1