Partager via


View.DispatchApplyWindowInsets(WindowInsets) Method

Definition

Request to apply the given window insets to this view or another view in its subtree.

[Android.Runtime.Register("dispatchApplyWindowInsets", "(Landroid/view/WindowInsets;)Landroid/view/WindowInsets;", "GetDispatchApplyWindowInsets_Landroid_view_WindowInsets_Handler")]
public virtual Android.Views.WindowInsets? DispatchApplyWindowInsets (Android.Views.WindowInsets? insets);
[<Android.Runtime.Register("dispatchApplyWindowInsets", "(Landroid/view/WindowInsets;)Landroid/view/WindowInsets;", "GetDispatchApplyWindowInsets_Landroid_view_WindowInsets_Handler")>]
abstract member DispatchApplyWindowInsets : Android.Views.WindowInsets -> Android.Views.WindowInsets
override this.DispatchApplyWindowInsets : Android.Views.WindowInsets -> Android.Views.WindowInsets

Parameters

insets
WindowInsets

Insets to apply

Returns

The provided insets minus the insets that were consumed

Attributes

Remarks

Request to apply the given window insets to this view or another view in its subtree.

This method should be called by clients wishing to apply insets corresponding to areas obscured by window decorations or overlays. This can include the status and navigation bars, action bars, input methods and more. New inset categories may be added in the future. The method returns the insets provided minus any that were applied by this view or its children.

Clients wishing to provide custom behavior should override the #onApplyWindowInsets(WindowInsets) method or alternatively provide a OnApplyWindowInsetsListener via the #setOnApplyWindowInsetsListener(View.OnApplyWindowInsetsListener) setOnApplyWindowInsetsListener method.

This method replaces the older #fitSystemWindows(Rect) fitSystemWindows method.

Java documentation for android.view.View.dispatchApplyWindowInsets(android.view.WindowInsets).

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