다음을 통해 공유


ViewGroup.DetachViewFromParent Method

Definition

Overloads

DetachViewFromParent(View)

Detaches a view from its parent.

DetachViewFromParent(Int32)

Detaches a view from its parent.

DetachViewFromParent(View)

Detaches a view from its parent.

[Android.Runtime.Register("detachViewFromParent", "(Landroid/view/View;)V", "GetDetachViewFromParent_Landroid_view_View_Handler")]
protected virtual void DetachViewFromParent (Android.Views.View? child);
[<Android.Runtime.Register("detachViewFromParent", "(Landroid/view/View;)V", "GetDetachViewFromParent_Landroid_view_View_Handler")>]
abstract member DetachViewFromParent : Android.Views.View -> unit
override this.DetachViewFromParent : Android.Views.View -> unit

Parameters

child
View

the child to detach

Attributes

Remarks

Detaches a view from its 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.detachViewFromParent(android.view.View).

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.

See also

  • DetachViewFromParent(Int32)
  • <xref:Android.Views.ViewGroup.DetachViewsFromParent(System.Int32%2c+System.Int32)>
  • DetachAllViewsFromParent()
  • <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)>

Applies to

DetachViewFromParent(Int32)

Detaches a view from its parent.

[Android.Runtime.Register("detachViewFromParent", "(I)V", "GetDetachViewFromParent_IHandler")]
protected virtual void DetachViewFromParent (int index);
[<Android.Runtime.Register("detachViewFromParent", "(I)V", "GetDetachViewFromParent_IHandler")>]
abstract member DetachViewFromParent : int -> unit
override this.DetachViewFromParent : int -> unit

Parameters

index
Int32

the index of the child to detach

Attributes

Remarks

Detaches a view from its 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.detachViewFromParent(int).

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.

See also

  • DetachViewFromParent(View)
  • DetachAllViewsFromParent()
  • <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)>

Applies to