Android SDK可防止Toast消失 [英] Android SDK keep Toast from fading away

查看:167
本文介绍了Android SDK可防止Toast消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速提问:是否有一种方法可以显示一条吐司消息,直到我在其上调用cancel()时它才会消失?

Quick question: Is there a way to display a toast message that doesn't fade away until I call cancel() on it?

我尝试将duration设置为类似9999的方式,但这不起作用.

I have tried setting the duration to something like 9999 but that doesn't work.

推荐答案

有没有一种方法可以显示吐司消息,直到我在其上调用cancel()才消失?

Is there a way to display a toast message that doesn't fade away until I call cancel() on it?

否,不是直接从SDK中获取,而是您可以通过多次调用show()来调整"您的Toast,使其寿命更长,您希望使用线程多次.有关更多信息,请参见本文.

No, not directly from the SDK, but you can "tweak" your Toast to make it live longer by calling show() on it as many times you wish using threads. See this article for more information.

这篇关于Android SDK可防止Toast消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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