How to set visibility of TextView? [closed]

我怕爱的太早我们不能终老 提交于 2019-12-13 09:09:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!