Reputation: 2318
I can't change its color or use alpha because the background may change and I won't know its color! Is there any other way to set it to invisible ? Also I don't want to set the text view invisible since I want the background to be visible!
Upvotes: 2
Views: 2985
Reputation: 3926
why not, set text value as empty string when you want to make it invisible. keep backup of the original value so that you can use it later when required.
Upvotes: 1
Reputation: 9791
Try:
textView.setTextColor(getResources().getColor(android.R.color.transparent));
Upvotes: 6
Reputation: 2821
You can set a textview to INVISIBLE:
myTextView.setVisibility(View.INVISIBLE);
That way the textview will still be present but not seen
Upvotes: 5
Reputation: 13501
Something like this..
String text = "Invisible Text";
TextView text1 = new TextView();
text1.setTag(text);
Upvotes: 1