能在Android吐司长于" Toast.LENGTH_LONG"? [英] Can an Android Toast be longer than "Toast.LENGTH_LONG"?

查看:273
本文介绍了能在Android吐司长于" Toast.LENGTH_LONG"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用setDuration的吐司是可以设置自定义的长度至少比Toast.LENGTH_LONG东西长?

When using setDuration for a Toast is it possible to set a custom length or at least something longer than Toast.LENGTH_LONG?

推荐答案

的<一个值href="http://developer.android.com/reference/android/widget/Toast.html#LENGTH_SHORT"><$c$c>LENGTH_SHORT和<一href="http://developer.android.com/reference/android/widget/Toast.html#LENGTH_LONG"><$c$c>LENGTH_LONG 0和1。这意味着它们将被视为标志,而不是实际的持续时间,所以我不认为这将有可能将期限设为什么比这些值等。

The values of LENGTH_SHORT and LENGTH_LONG are 0 and 1. This means they are treated as flags rather than actual durations so I don't think it will be possible to set the duration to anything other than these values.

如果你想显示一条消息,更长的用户,可以考虑状态栏通知。状态栏通知可以通过编程方式取消时,他们不再相关。

If you want to display a message to the user for longer, consider a Status Bar Notification. Status Bar Notifications can be programmatically cancelled when they are no longer relevant.

这篇关于能在Android吐司长于&QUOT; Toast.LENGTH_LONG&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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