Android7.0中文文档(API)-- Toast

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/Toast.html

Toast

public class Toast
extends Object

java.lang.Object
   ↳ android.widget.Toast


A toast is a view containing a quick little message for the user. The toast class helps you create and show those.
Toast是一个视图,其中包含了显示给用户一条简短的消息。Toast类帮助你创建和显示这样的消息。

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.
当视图显示给用户时,通常显示为一个覆盖着应用程序上的浮动视图。它永远不会接收焦点。用户不会在其中输入什么。这样做的目的是尽可能地不引人注目,同时向用户显示你希望他们看到的信息。两个例子,一个是音量控制,另外一个是显示一条简短的消息,以提示你的设置已经保存。

The easiest way to use this class is to call one of the static methods that constructs everything you need and returns a new Toast object.

Developer Guides


使用这个类的最简单的方法是调用一个静态方法来构造你需要的所有东西,并返回一个新的Toast对象。

开发者指南

For information about creating Toast notifications, read the Toast Notifications developer guide.
关于创建Toast的更多信息,请参考Toast Notifications开发者指南。

摘要


常量

int LENGTH_LONG

Show the view or text notification for a long period of time.
显示长时间的视图或文本通知。

int LENGTH_SHORT

Show the view or text notification for a short period of time.
显示短时间的视图或文本通知。

Public构造方法

Toast(Context context)

Construct an empty Toast object.
创建一个空的Toast对象。

你可能感兴趣的:(Android,android7.0中文API,android中文文档)