android:visibility - Hide a TextView, in XML

How to Hide a TextView, in XML

android:visibility was added in API Level 1
Controls the initial visibility of the view.

1. Add a TextView in your main.xml file.

2. In the main.xml file, add the code below.

       android:visibility = "gone"

3. All options:

visibile - Visible on screen; the default value.
invisible - Not displayed, but taken into account during layout (space is left for it).
gone - Completely hidden, as if the view had not been added.

4. Compile and run!

Related Articles: