Android.Views.ViewGroup.AttachViewToParent Method
Attaches a view to this view group.

Syntax

[Android.Runtime.Register("attachViewToParent", "(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V", "GetAttachViewToParent_Landroid_view_View_ILandroid_view_ViewGroup_LayoutParams_Handler")]
protected virtual void AttachViewToParent (View child, int index, ViewGroup.LayoutParams params)

See Also

ViewGroup.RemoveDetachedView(View, System.Boolean)
ViewGroup.DetachAllViewsFromParent
ViewGroup.DetachViewFromParent(View)
ViewGroup.DetachViewFromParent(int)

Parameters

child
the child to attach
index
the index at which the child should be attached
params
the layout parameters of the child

Remarks

Attaches a view to this view group. Attaching a view assigns this group as the parent, sets the layout parameters and puts the view in the list of children so that it can be retrieved by calling ViewGroup.GetChildAt(int).

This method is intended to be lightweight and makes no assumptions about whether the parent or child should be redrawn. Proper use of this method will include also making any appropriate View.RequestLayout or View.Invalidate calls. For example, callers can View.Post(Java.Lang.IRunnable) a Java.Lang.IRunnable which performs a View.RequestLayout on the next frame, after all detach/attach calls are finished, causing layout to be run prior to redrawing the view hierarchy.

This method should be called only for views which were detached from their parent.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1