Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide and show linearlayout

I have one linearlayout and have also a few button inside it.I want make it visible when touch and invisible when touch it again.

How can i make it??

like image 563
Koko Krunch Avatar asked Jan 14 '13 05:01

Koko Krunch


1 Answers

LinearLayout one = (LinearLayout) findViewById(R.id.one);
one.setVisibility(View.GONE);

I suggest that you use GONE insteady of INVISIBLE in the onclick event because with View.GONE the place for the layout will not be visible and the application will not appear to have unused space in it unlike the View.INVISIBLE that will leave the gap that is intended for the the layout

like image 152
Ruyonga Dan Avatar answered Oct 28 '22 16:10

Ruyonga Dan