共用方式為


View.OnAttachedToWindow Method

Definition

This is called when the view is attached to a window.

[Android.Runtime.Register("onAttachedToWindow", "()V", "GetOnAttachedToWindowHandler")]
protected virtual void OnAttachedToWindow ();
[<Android.Runtime.Register("onAttachedToWindow", "()V", "GetOnAttachedToWindowHandler")>]
abstract member OnAttachedToWindow : unit -> unit
override this.OnAttachedToWindow : unit -> unit
Attributes

Remarks

This is called when the view is attached to a window. At this point it has a Surface and will start drawing. Note that this function is guaranteed to be called before #onDraw(android.graphics.Canvas), however it may be called any time before the first onDraw -- including before or after #onMeasure(int, int).

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

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