I have items in my View which are displayd on click and does not show up on that start of the activity.
Now everything works fine but when i use the graphical layout tool i see those items and it makes working with it harder.
Meaning, i have a ListView with items, i see those items on top of everything.
How can i hide those elements? setting the visibility programaticlly dosen’t help.
Should i do something like setting alpha to 0 and then add it instead of making items invisible?
Seems like a dumb idea, there must be some option i’m missing.
Help anyone?
Thanks,
Eric
Why not set the visibility to ‘gone’:
android:visibility="gone"? That will prevent layout items from showing up and taking up space in the layout.Alternatively, if some elements in your view hierarchy may never be shown to the user at all, you could use
ViewStubs to ‘lazily’ load them at runtime. AViewStubis simply a placeholder for some other view (hierarchy) and is empty and zero-sized by itself. It’s a good way of separating your view hierarchy into default and optional elements, and can potentialy reduce the complexity of the view hierarchy at runtime significantly.