Android Guides | Samples

Android.Widget.GridLayout.LayoutParams Class

Layout information associated with each of the children of a GridLayout.

See Also: GridLayout+LayoutParams

Syntax

[Android.Runtime.Register("android/widget/GridLayout$LayoutParams", DoNotGenerateAcw=true)]
public class GridLayout.LayoutParams : ViewGroup+MarginLayoutParams

Remarks

Layout information associated with each of the children of a GridLayout.

GridLayout supports both row and column spanning and arbitrary forms of alignment within each cell group. The fundamental parameters associated with each cell group are gathered into their vertical and horizontal components and stored in the GridLayout+LayoutParams.RowSpec and GridLayout+LayoutParams.ColumnSpec layout parameters. GridLayout+Spec are immutable structures and may be shared between the layout parameters of different children.

The row and column specs contain the leading and trailing indices along each axis and together specify the four grid indices that delimit the cells of this cell group.

The alignment properties of the row and column specs together specify both aspects of alignment within the cell group. It is also possible to specify a child's alignment within its cell group by using the GridLayout+LayoutParams.SetGravity(GravityFlags) method.

WRAP_CONTENT and MATCH_PARENT

Because the default values of the LayoutParams.Width and LayoutParams.Height properties are both ViewGroup+LayoutParams.WrapContent, this value never needs to be explicitly declared in the layout parameters of GridLayout's children. In addition, GridLayout does not distinguish the special size value LayoutParams.MatchParent from ViewGroup+LayoutParams.WrapContent. A component's ability to expand to the size of the parent is instead controlled by the principle of flexibility, as discussed in GridLayout.

Summary

You should not need to use either of the special size values: WRAP_CONTENT or MATCH_PARENT when configuring the children of a GridLayout.

Default values

See GridLayout for a more complete description of the conventions used by GridLayout in the interpretation of the properties of this class.

[Android Documentation]

Requirements

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

The members of Android.Widget.GridLayout.LayoutParams are listed below.

See Also: ViewGroup+MarginLayoutParams

Public Constructors

Constructs a new LayoutParams with default values as defined in GridLayout+LayoutParams.
Values not defined in the attribute set take the default values defined in GridLayout+LayoutParams.
Constructs a new LayoutParams instance for this rowSpec and columnSpec.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

ColumnSpecGridLayout+Spec. The spec that defines the horizontal characteristics of the cell group described by these layout parameters.
RowSpecGridLayout+Spec. The spec that defines the vertical characteristics of the cell group described by these layout parameters.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

SetGravity(GravityFlags)
Describes how the child views are positioned.