Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you hide an element in a layout, such as a spinner, depending on an activity?

I am working on my app which has 3 spinners in one view. Some of my activities will need to use 3 spinners, some 2, some 1, so I would like to hide them depending on the activity, if that is even possible. I am trying to do it like this so I can be as efficient as possible, but I have no idea if it is even possible.

like image 303
SickNick Avatar asked Dec 18 '10 22:12

SickNick


People also ask

How do you hide a spinner?

You can hide spinner in the ProgressButton by setting the e-hide-spinner property to cssClass .


2 Answers

Call setVisibility(View.INVISIBLE) or setVisibility(View.GONE) on the Spinners as needed to hide them. GONE means totally gone; INVISIBLE means they still take up space but no pixels are drawn.

like image 120
CommonsWare Avatar answered Oct 11 '22 14:10

CommonsWare


You can use a View's method setVisibility: You can hide or show views using setVisibility(int visibility).

Where the argument can be INVISIBLE or GONE, depending on whether you want it to take up any space when it's invisible.

like image 38
NickT Avatar answered Oct 11 '22 16:10

NickT