I have a linear vertical layout as below. I need in my application to switch the Button and the TextView. To hide button and show text then change etc. If I use setVisibilit
You should used setVisibility(View.GONE)
instead of setVisibility(View.INVISIBLE)
.
For more information go to: http://developer.android.com/reference/android/view/View.html
use-
button.setVisibility(View.GONE);
Suppose your created button is as follows...
Button button = (Button) findViewById(R.id.stopButton);
When you want to hide that Button write this...
button.setVisibility(View.GONE);
And when you want to show that button again then write...
button.setVisibility(View.VISIBLE);