tags:

views:

99

answers:

2

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
I didn't know GONE existed. Thanks, I'm still brand new to Android
JonF
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