GridExtensions.Add 方法

定义

重载

Add(Grid, IView, Int32, Int32)

将 添加到IViewGrid指定列和行的行,行范围为 1,列跨度为 1。

Add(Grid, IView, Int32, Int32, Int32, Int32)
已过时.

将 添加到IViewGrid指定行和列跨度的 。

Add(Grid, IView, Int32, Int32)

将 添加到IViewGrid指定列和行的行,行范围为 1,列跨度为 1。

public static void Add (this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int column = 0, int row = 0);
static member Add : Microsoft.Maui.Controls.Grid * Microsoft.Maui.IView * int * int -> unit
<Extension()>
Public Sub Add (grid As Grid, view As IView, Optional column As Integer = 0, Optional row As Integer = 0)

参数

grid
Grid

Grid将添加到的 IView

view
IView

要添加的 IView

column
Int32

要在其中放置 的 IView列。

row
Int32

要在其中放置 的 IView行。

例外

view 为 null 时引发。

当 或 column 小于 0 时row引发。

注解

Grid如果 没有足够的行/列来包含指定位置,则将添加它们。

适用于

Add(Grid, IView, Int32, Int32, Int32, Int32)

注意

This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.

将 添加到IViewGrid指定行和列跨度的 。

public:
[System::Runtime::CompilerServices::Extension]
 static void Add(Microsoft::Maui::Controls::Grid ^ grid, Microsoft::Maui::IView ^ view, int left, int right, int top, int bottom);
[System.Obsolete("This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.")]
public static void Add (this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int left, int right, int top, int bottom);
[<System.Obsolete("This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.")>]
static member Add : Microsoft.Maui.Controls.Grid * Microsoft.Maui.IView * int * int * int * int -> unit
<Extension()>
Public Sub Add (grid As Grid, view As IView, left As Integer, right As Integer, top As Integer, bottom As Integer)

参数

grid
Grid

Grid将添加到的 IView

view
IView

要添加的 IView

left
Int32

列范围的左边缘。 必须高于或等于 0。

right
Int32

列范围的右边缘。 必须大于左边缘。 IView不会占用此列,但会在它之前停止。

top
Int32

行范围的上边缘。 必须高于或等于 0。

bottom
Int32

行范围的下边缘。 必须大于上边缘。 IView不会占用此行,但会在它之前停止。

属性

例外

view 为 null 时引发。

当 或 top 小于 0、bottom小于或等于 topright 小于或等于 leftleft引发。

注解

Grid如果 没有足够的行/列来包含指定的范围,则将添加它们。

适用于