TITAN TITAN - 1 month ago 16
Android Question

How to set visibility of TextView?

I want to check! For example - if (tv.Visible == true) then showMessage ("Yee it's Visible") else ("Its not visible"); I hope you're understand!

Answer

You provide very little information, but I think this is what you are after...

TextView tv = (TextView)findViewById(R.id.textView);
tv.setVisibility(View.INVISIBLE);

You will need to adjust the id to your own.

EDIT: You can check to see if the TextView is already invisible by:

if (tv.getVisibility() == View.INVISIBLE) {
    // do something.
}
Comments