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)
Author by
Sarju Thakkar
Updated on November 28, 2022Comments
-
Sarju Thakkar over 1 year
Is there a thing like textview visibility on and off. Thanks in advance.
-
Moreno about 8 yearsPlease correct your mistyped at
YourTextView.setVisibility(View.VISIBLE);
. You missed thei
inbility
. Thanks.