In android studio am I able to hide and show a label/textview? if so what would i use?

22,930

Solution 1

In the XML you can set android:visibility="invisible" or "visible" In the Java code you can type YourTextView.setVisiblity(View.VISIBLE)

Solution 2

You can use android:visibility="visible" for setting visibility in xml. The options are visible|invisible|gone.

Or textview.setVisibility(View.VISIBLE) in code.

More info here http://developer.android.com/reference/android/view/View.html#setVisibility(int)

Share:
22,930
Sarju Thakkar
Author by

Sarju Thakkar

Updated on November 28, 2022

Comments

  • Sarju Thakkar
    Sarju Thakkar over 1 year

    Is there a thing like textview visibility on and off. Thanks in advance.

  • Moreno
    Moreno about 8 years
    Please correct your mistyped at YourTextView.setVisibility(View.VISIBLE);. You missed the i in bility. Thanks.