Sdílet prostřednictvím


ViewGroup.AddView Method

Definition

Overloads

AddView(View)

Adds a child view.

AddView(View, ViewGroup+LayoutParams)

Adds a child view.

AddView(View, Int32)

Adds a child view.

AddView(View, Int32, ViewGroup+LayoutParams)

Adds a child view.

AddView(View, Int32, Int32)

Adds a child view with this ViewGroup's default layout parameters and the specified width and height.

AddView(View)

Adds a child view.

[Android.Runtime.Register("addView", "(Landroid/view/View;)V", "GetAddView_Landroid_view_View_Handler")]
public virtual void AddView (Android.Views.View? child);
[<Android.Runtime.Register("addView", "(Landroid/view/View;)V", "GetAddView_Landroid_view_View_Handler")>]
abstract member AddView : Android.Views.View -> unit
override this.AddView : Android.Views.View -> unit

Parameters

child
View

the child view to add

Attributes

Remarks

Adds a child view. If no layout parameters are already set on the child, the default parameters for this ViewGroup are set on the child.

<strong>Note:</strong> do not invoke this method from #draw(android.graphics.Canvas), #onDraw(android.graphics.Canvas), #dispatchDraw(android.graphics.Canvas) or any related method.

Java documentation for android.view.ViewGroup.addView(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

Applies to

AddView(View, ViewGroup+LayoutParams)

Adds a child view.

[Android.Runtime.Register("addView", "(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V", "GetAddView_Landroid_view_View_Landroid_view_ViewGroup_LayoutParams_Handler")]
public virtual void AddView (Android.Views.View? child, Android.Views.ViewGroup.LayoutParams? params);
[<Android.Runtime.Register("addView", "(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V", "GetAddView_Landroid_view_View_Landroid_view_ViewGroup_LayoutParams_Handler")>]
abstract member AddView : Android.Views.View * Android.Views.ViewGroup.LayoutParams -> unit
override this.AddView : Android.Views.View * Android.Views.ViewGroup.LayoutParams -> unit

Parameters

child
View

the child view to add

params
ViewGroup.LayoutParams

the layout parameters to set on the child

Implements

Attributes

Remarks

Java documentation for android.view.ViewGroup.addView(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.

Applies to

AddView(View, Int32)

Adds a child view.

[Android.Runtime.Register("addView", "(Landroid/view/View;I)V", "GetAddView_Landroid_view_View_IHandler")]
public virtual void AddView (Android.Views.View? child, int index);
[<Android.Runtime.Register("addView", "(Landroid/view/View;I)V", "GetAddView_Landroid_view_View_IHandler")>]
abstract member AddView : Android.Views.View * int -> unit
override this.AddView : Android.Views.View * int -> unit

Parameters

child
View

the child view to add

index
Int32

the position at which to add the child

Attributes

Remarks

Adds a child view. If no layout parameters are already set on the child, the default parameters for this ViewGroup are set on the child.

<strong>Note:</strong> do not invoke this method from #draw(android.graphics.Canvas), #onDraw(android.graphics.Canvas), #dispatchDraw(android.graphics.Canvas) or any related method.

Java documentation for android.view.ViewGroup.addView(android.view.View, 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

Applies to

AddView(View, Int32, ViewGroup+LayoutParams)

Adds a child view.

[Android.Runtime.Register("addView", "(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V", "GetAddView_Landroid_view_View_ILandroid_view_ViewGroup_LayoutParams_Handler")]
public virtual void AddView (Android.Views.View? child, int index, Android.Views.ViewGroup.LayoutParams? params);
[<Android.Runtime.Register("addView", "(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V", "GetAddView_Landroid_view_View_ILandroid_view_ViewGroup_LayoutParams_Handler")>]
abstract member AddView : Android.Views.View * int * Android.Views.ViewGroup.LayoutParams -> unit
override this.AddView : Android.Views.View * int * Android.Views.ViewGroup.LayoutParams -> unit

Parameters

child
View

the child view to add

index
Int32

the position at which to add the child or -1 to add last

params
ViewGroup.LayoutParams

the layout parameters to set on the child

Attributes

Remarks

Java documentation for android.view.ViewGroup.addView(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.

Applies to

AddView(View, Int32, Int32)

Adds a child view with this ViewGroup's default layout parameters and the specified width and height.

[Android.Runtime.Register("addView", "(Landroid/view/View;II)V", "GetAddView_Landroid_view_View_IIHandler")]
public virtual void AddView (Android.Views.View? child, int width, int height);
[<Android.Runtime.Register("addView", "(Landroid/view/View;II)V", "GetAddView_Landroid_view_View_IIHandler")>]
abstract member AddView : Android.Views.View * int * int -> unit
override this.AddView : Android.Views.View * int * int -> unit

Parameters

child
View

the child view to add

width
Int32
height
Int32
Attributes

Remarks

Adds a child view with this ViewGroup's default layout parameters and the specified width and height.

<strong>Note:</strong> do not invoke this method from #draw(android.graphics.Canvas), #onDraw(android.graphics.Canvas), #dispatchDraw(android.graphics.Canvas) or any related method.

Java documentation for android.view.ViewGroup.addView(android.view.View, int, 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.

Applies to