Class GridLayout

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll

GridLayout is a 2D grid pattern layout that consists of a set of rows and columns.

C#
Copy
public class GridLayout : LayoutGroup, IDisposable, ILayoutParent
Inheritance
System.Object
GridLayout
Implements
System.IDisposable

Constructors

View Source

GridLayout()

GridLayout Constructor.

Declaration
C#
Copy
public GridLayout()
API Level: 6

Properties

View Source

Columns

Gets or Sets the number of columns in the grid.

Declaration
C#
Copy
public int Columns { get; set; }
Property Value
Type Description
Int32
API Level: 6
View Source

ColumnSpacing

The distance between columns.

Declaration
C#
Copy
public float ColumnSpacing { get; set; }
Property Value
Type Description
System.Single
API Level: 8
View Source

GridOrientation

Get/Set the orientation in the layout

Declaration
C#
Copy
public GridLayout.Orientation GridOrientation { get; set; }
Property Value
Type Description
GridLayout.Orientation
Exceptions
Type Condition
System.ComponentModel.InvalidEnumArgumentException

Thrown when using invalid arguments that are enumerators.

API Level: 8
View Source

Rows

Gets or Sets the number of rows in the grid.

Declaration
C#
Copy
public int Rows { get; set; }
Property Value
Type Description
Int32
API Level: 8
View Source

RowSpacing

The distance between rows.

Declaration
C#
Copy
public float RowSpacing { get; set; }
Property Value
Type Description
System.Single
API Level: 8

Methods

View Source

GetColumn(View)

Gets the column index.

Declaration
C#
Copy
public static int GetColumn(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
Int32

The column index of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

GetColumnSpan(View)

Gets the column span.

Declaration
C#
Copy
public static int GetColumnSpan(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
Int32

The column span of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

GetHorizontalAlignment(View)

Gets the horizontal alignment of this child.

Declaration
C#
Copy
public static GridLayout.Alignment GetHorizontalAlignment(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
GridLayout.Alignment

The horizontal alignment of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

GetHorizontalStretch(View)

Gets the value how child is resized within its horizontal space.

Declaration
C#
Copy
public static GridLayout.StretchFlags GetHorizontalStretch(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
GridLayout.StretchFlags

The horizontal stretch flag of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

GetRow(View)

Gets the row index.

Declaration
C#
Copy
public static int GetRow(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
Int32

The row index of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

GetRowSpan(View)

Gets the row span.

Declaration
C#
Copy
public static int GetRowSpan(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
Int32

The row span of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

GetVerticalAlignment(View)

Gets the vertical alignment of this child.

Declaration
C#
Copy
public static GridLayout.Alignment GetVerticalAlignment(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
GridLayout.Alignment

The vertical alignment of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

GetVerticalStretch(View)

Gets the value how child is resized within its vertical space.

Declaration
C#
Copy
public static GridLayout.StretchFlags GetVerticalStretch(View view)
Parameters
Type Name Description
View view

The child view.

Returns
Type Description
GridLayout.StretchFlags

The vertical stretch flag of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

API Level: 8
View Source

OnLayout(Boolean, LayoutLength, LayoutLength, LayoutLength, LayoutLength)

Assign a size and position to each of its children.

Declaration
C#
Copy
protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
Parameters
Type Name Description
Boolean changed

This is a new size or position for this layout.

LayoutLength left

Left position, relative to parent.

LayoutLength top

Top position, relative to parent.

LayoutLength right

Right position, relative to parent.

LayoutLength bottom

Bottom position, relative to parent.

Overrides
API Level: 6
View Source

OnMeasure(MeasureSpecification, MeasureSpecification)

Measure the layout and its content to determine the measured width and the measured height.

Declaration
C#
Copy
protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
Parameters
Type Name Description
MeasureSpecification widthMeasureSpec

horizontal space requirements as imposed by the parent.

MeasureSpecification heightMeasureSpec

vertical space requirements as imposed by the parent.

Overrides
API Level: 6
View Source

SetColumn(View, Int32)

Sets the column index the child occupies. A default column is Tizen.NUI.GridLayout.AutoColumn.
If column is a Tizen.NUI.GridLayout.AutoColumn, child will be automatically laid out depending on GridOrientation.

Declaration
C#
Copy
public static void SetColumn(View view, int value)
Parameters
Type Name Description
View view

The child view.

Int32 value

The column index of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value cannot be a negative value other than Tizen.NUI.GridLayout.AutoColumn.

API Level: 8
View Source

SetColumnSpan(View, Int32)

Sets the column span the child occupies. the default value is 1.

Declaration
C#
Copy
public static void SetColumnSpan(View view, int value)
Parameters
Type Name Description
View view

The child view.

Int32 value

The column span of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value cannot be less than 1.

API Level: 8
View Source

SetHorizontalAlignment(View, GridLayout.Alignment)

Set the horizontal alignment of this child inside the cells. Start by default.

Declaration
C#
Copy
public static void SetHorizontalAlignment(View view, GridLayout.Alignment value)
Parameters
Type Name Description
View view

The child view.

GridLayout.Alignment value

The horizontal alignment flag of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value should be GridLayout.Alignment.

API Level: 8
View Source

SetHorizontalStretch(View, GridLayout.StretchFlags)

Sets the value how child is resized within its horizontal space. None by default.

Declaration
C#
Copy
public static void SetHorizontalStretch(View view, GridLayout.StretchFlags value)
Parameters
Type Name Description
View view

The child view.

GridLayout.StretchFlags value

The horizontal stretch flag of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value should be GridLayout.StretchFlags.

API Level: 8
View Source

SetRow(View, Int32)

Sets the row index the child occupies. A default row index is Tizen.NUI.GridLayout.AutoRow.
If row is a Tizen.NUI.GridLayout.AutoRow, child will be automatically laid out depending on GridOrientation.

Declaration
C#
Copy
public static void SetRow(View view, int value)
Parameters
Type Name Description
View view

The child view.

Int32 value

The row index of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value cannot be a negative value other than Tizen.NUI.GridLayout.AutoRow.

API Level: 8
View Source

SetRowSpan(View, Int32)

Sets the row span the child occupies. the default value is 1.

Declaration
C#
Copy
public static void SetRowSpan(View view, int value)
Parameters
Type Name Description
View view

The child view.

Int32 value

The row span of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value cannot be less than 1.

API Level: 8
View Source

SetVerticalAlignment(View, GridLayout.Alignment)

Set the vertical alignment of this child inside the cells.

Declaration
C#
Copy
public static void SetVerticalAlignment(View view, GridLayout.Alignment value)
Parameters
Type Name Description
View view

The child view.

GridLayout.Alignment value

The vertical alignment flag of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value should be GridLayout.Alignment.

API Level: 8
View Source

SetVerticalStretch(View, GridLayout.StretchFlags)

Set the value how child is resized within its vertical space. None by default.

Declaration
C#
Copy
public static void SetVerticalStretch(View view, GridLayout.StretchFlags value)
Parameters
Type Name Description
View view

The child view.

GridLayout.StretchFlags value

The vertical stretch flag of view.

Exceptions
Type Condition
System.ArgumentNullException

The view cannot be null.

System.ArgumentException

The value should be GridLayout.StretchFlags.

API Level: 8

Implements

System.IDisposable