Share via


ViewTreeObserver.IOnPreDrawListener.OnPreDraw Method

Definition

Callback method to be invoked when the view tree is about to be drawn.

[Android.Runtime.Register("onPreDraw", "()Z", "GetOnPreDrawHandler:Android.Views.ViewTreeObserver/IOnPreDrawListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OnPreDraw ();
[<Android.Runtime.Register("onPreDraw", "()Z", "GetOnPreDrawHandler:Android.Views.ViewTreeObserver/IOnPreDrawListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnPreDraw : unit -> bool

Returns

Return true to proceed with the current drawing pass, or false to cancel.

Attributes

Remarks

Callback method to be invoked when the view tree is about to be drawn. At this point, all views in the tree have been measured and given a frame. Clients can use this to adjust their scroll bounds or even to request a new layout before drawing occurs.

Java documentation for android.view.ViewTreeObserver.OnPreDrawListener.onPreDraw().

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

  • <xref:Android.Views.View.OnMeasure(System.Int32%2c+System.Int32)>
  • <xref:Android.Views.View.OnLayout(System.Boolean%2c+System.Int32%2c+System.Int32%2c+System.Int32%2c+System.Int32)>
  • OnDraw(Canvas)