View.ViewTreeObserver Property

Definition

Returns the ViewTreeObserver for this view's hierarchy.

public virtual Android.Views.ViewTreeObserver? ViewTreeObserver { [Android.Runtime.Register("getViewTreeObserver", "()Landroid/view/ViewTreeObserver;", "GetGetViewTreeObserverHandler")] get; }
[<get: Android.Runtime.Register("getViewTreeObserver", "()Landroid/view/ViewTreeObserver;", "GetGetViewTreeObserverHandler")>]
member this.ViewTreeObserver : Android.Views.ViewTreeObserver

Property Value

The ViewTreeObserver for this view's hierarchy.

Attributes

Remarks

Returns the ViewTreeObserver for this view's hierarchy. The view tree observer can be used to get notifications when global events, like layout, happen.

The returned ViewTreeObserver observer is not guaranteed to remain valid for the lifetime of this View. If the caller of this method keeps a long-lived reference to ViewTreeObserver, it should always check for the return value of ViewTreeObserver#isAlive().

Java documentation for android.view.View.getViewTreeObserver().

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