Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide/show an element when a button is pressed?

I'm trying to learn how to develop Android using the Eclipse IDE. What I'm trying to do right now is make a hidden TableLayout visible when a button is pressed. However, I have no idea as to what I need to put in the button's OnClick property.

Also, are there any tutorials online that could help me learn how to develop Android apps in Eclipse?

Thanks!

like image 946
bearchase Avatar asked Feb 19 '11 17:02

bearchase


1 Answers

TableLayout tl = (TableLayout)findeViewById(R.id.yourtablelayout);

tl.setVisibility(View.VISIBLE);

Something like that within your onClick() method should do the trick.

like image 163
AverageMarcus Avatar answered Sep 23 '22 22:09

AverageMarcus