问题
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!
回答1:
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.
}
来源:https://stackoverflow.com/questions/34822485/how-to-set-visibility-of-textview