【发布时间】:2018-12-31 10:30:00
【问题描述】:
这里我在 Xamarin Forms Android 中显示 toast 消息
我的代码: 在我的 Android 类中
public void ShortAlert(string message)
{
Toast.MakeText(Forms.Context, message, ToastLength.Short).Show();
}
当用户单击 A 按钮时,我正在显示此 toast 消息。但是当用户快速单击按钮时,它会持续闪烁(5 次按钮单击显示 toast 5 次)。 所以我想如果用户第二次点击这个按钮,那么之前的 toast 应该被取消。 如何在 Xamarin 形式的 android 中做到这一点?
【问题讨论】:
-
所以你只想展示这个吐司一次,然后再也不展示?
-
不不。我希望如果用户快速点击一个按钮,那么它只显示一次。
标签: xamarin xamarin.forms