Compartilhar via


ViewGroup.DetachAllViewsFromParent Method

Definition

Detaches all views from the parent.

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

Remarks

Detaches all views from the parent. Detaching a view should be followed either by a call to #attachViewToParent(View, int, android.view.ViewGroup.LayoutParams) or a call to #removeDetachedView(View, boolean). Detachment should only be temporary; reattachment or removal should happen within the same drawing cycle as detachment. When a view is detached, its parent is null and cannot be retrieved by a call to #getChildAt(int).

Java documentation for android.view.ViewGroup.detachAllViewsFromParent().

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

  • DetachViewFromParent(View)
  • DetachViewFromParent(Int32)
  • <xref:Android.Views.ViewGroup.DetachViewsFromParent(System.Int32%2c+System.Int32)>
  • <xref:Android.Views.ViewGroup.AttachViewToParent(Android.Views.View%2c+System.Int32%2c+System.Int32)>
  • <xref:Android.Views.ViewGroup.RemoveDetachedView(Android.Views.View%2c+System.Boolean)>