I would like to make a LinearLayout that was created from xml invisible, and another LinearLayout visible to replace it. The replacement layout starts out as invisible. When I make the originally visible layout invisible, it still leaves space for it on the screen. How can I refresh the screen so that space is gone?
+2
A:
Perhaps you are mixing up View.INVISIBLE
with View.GONE
:
int GONE
This view is invisible, and it doesn't take any space for layout purposes.
int INVISIBLE
This view is invisible, but it still takes up space for layout purposes.
aioobe
2010-06-06 18:10:24
I didn't know GONE existed. Thanks, I'm still brand new to Android
JonF
2010-06-08 19:25:56
A:
I have done this before and its actually very simple. Make 2 different layout xml files, one for each layout you want to show. When you want to switch from one to the other, all you have to do is call setContentView(R.layout.some_layout)
and you're done!
pretty easy eh?
mtmurdock
2010-06-06 18:24:05