当前标签 / 仿微信Toast / 总共1篇

教你如何高仿实现微信录音 Toast

Toast 介绍

平时我们在Android开发中会经常用到一个叫Toast的东西,官方解释如下:

A toast is a view containing a quick little message for the user. The toast class helps you create and show those. When the view is shown to the user, appears as a floating view over the application. It will never receive focus. The user will probably be in the middle of typing something else. The idea is to be as unobtrusive as possible, while still showing the user the information you want them to see. Two examples are the volume control, and the brief message saying that your settings have been saved.

Toast 最基本的用法很简单,不用说大家都会(这里切记要调用 show() 去显示)

public static void showToast(Context context){
    Toast.makeText(context, "欢迎关注水寒的CSDN博客", Toast.LENGTH_LONG).show();
}

显示Toast示例

阅读更多