如何设置TextView的可见性? [英] How to set visibility of TextView?

查看:267
本文介绍了如何设置TextView的可见性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要检查!例如-如果(tv.Visible == true),则showMessage(是,它是可见的")else(它不可见");希望您能理解!

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!

推荐答案

您提供的信息很少,但是我认为这是您想要的...

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);

您需要将ID调整为自己的ID.

You will need to adjust the id to your own.

您可以检查TextView是否已被以下人员隐藏:

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

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

这篇关于如何设置TextView的可见性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆