imagine an Android app that has 3 TextViews in a linear layout, one sequentially below the other, then 2 buttons. 1 button needs to hide the second text view, and the second button needs to make it visible again.
The only requirement is that when the second text view goes away, it should not occupy any space, meaning that third text view should occupy its space while it is gone.
I tried this with the INVISIBLE and VISIBLE settings, however, a blank placeholder remains in the place of the second text view.
I tried with GONE, which eliminated the blank space, however I could not make the second text view appear again.
Do you know a way to achieve this?
Example:
////////////////////////////
initial state:
textview1
textview2
textview3
button1
button2
--> user pushes button1
new state:
textview1
textview3
button1
button2
--> user pushes button2
new state: initial state
////////////////////////////
Thanks