隐藏的TextView在Android中一段时间​​后, [英] Hide TextView after some time in Android

查看:240
本文介绍了隐藏的TextView在Android中一段时间​​后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要一些时间间隔后隐藏的TextView说3秒。我用Google搜索,发现了一些code,我试图code如下图所示,但它不工作。搜索结果
请告诉我什么是错呢?

I want to hide TextView after some time interval say 3 seconds. I googled and found some code and I tried code as shown below but It is not working.

Please tell me what is the wrong with this ?

tvRQPoint.setText("+0");
tvRQPoint.postDelayed(new Runnable() {
    public void run() {
        tvRQPoint.setText("+0");
    }
}, 3000);

还有一件事,如何删除超时?当我用这对点击的ListView 事件,如果一个选项,然后用户点击点击第二个选项,然后3秒克服了(点击第一个选项后),它不显示第二个选项3秒

One more thing, how to remove timeout ? As I am using this on click event of ListView, If user clicks on one option and then clicks on second option, then as 3 seconds got over (after clicked on first option), It does not show second option for 3 seconds.

推荐答案

尝试视图中不可见 GONE ,如:

tvRQPoint.postDelayed(new Runnable() {
public void run() {
    tvRQPoint.setVisibility(View.INVISIBLE);
}
}, 3000);

设置查看知名度view.setVisibility(View.INVISIBLE|View.VISIBLE|View.GONE);

这篇关于隐藏的TextView在Android中一段时间​​后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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