Freigeben über


Toast.View Property

Definition

Return the view. -or- Set the view to show.

public virtual Android.Views.View? View { [Android.Runtime.Register("getView", "()Landroid/view/View;", "GetGetViewHandler")] get; [Android.Runtime.Register("setView", "(Landroid/view/View;)V", "GetSetView_Landroid_view_View_Handler")] set; }
[<get: Android.Runtime.Register("getView", "()Landroid/view/View;", "GetGetViewHandler")>]
[<set: Android.Runtime.Register("setView", "(Landroid/view/View;)V", "GetSetView_Landroid_view_View_Handler")>]
member this.View : Android.Views.View with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Return the view.

Toasts constructed with #Toast(Context) that haven't called #setView(View) with a non-null view will return null here.

Starting from Android Build.VERSION_CODES#R, in apps targeting API level Build.VERSION_CODES#R or higher, toasts constructed with #makeText(Context, CharSequence, int) or its variants will also return null here unless they had called #setView(View) with a non-null view. If you want to be notified when the toast is shown or hidden, use #addCallback(Callback).

This member is deprecated. Custom toast views are deprecated. Apps can create a standard text toast with the #makeText(Context, CharSequence, int) method, or use a Snackbar when in the foreground. Starting from Android Build.VERSION_CODES#R, apps targeting API level Build.VERSION_CODES#R or higher that are in the background will not have custom toast views displayed.

Java documentation for android.widget.Toast.getView().

Property setter documentation:

Set the view to show.

This member is deprecated. Custom toast views are deprecated. Apps can create a standard text toast with the #makeText(Context, CharSequence, int) method, or use a Snackbar when in the foreground. Starting from Android Build.VERSION_CODES#R, apps targeting API level Build.VERSION_CODES#R or higher that are in the background will not have custom toast views displayed.

Java documentation for android.widget.Toast.setView(android.view.View).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also