Android Guides | Samples

Android.Widget.GridView Class

A view that shows items in two-dimensional scrolling grid.

See Also: GridView

Syntax

[Android.Runtime.Register("android/widget/GridView", DoNotGenerateAcw=true)]
public class GridView : AbsListView

Remarks

A view that shows items in two-dimensional scrolling grid. The items in the grid come from the IListAdapter associated with this view.

See the Grid View guide.

[Android Documentation]

Requirements

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

The members of Android.Widget.GridView are listed below.

See Also: AbsListView

Public Constructors

Protected Constructors

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

Public Properties

override
AdapterIListAdapter. Returns the adapter currently associated with this widget.
[read-only]
ColumnWidthInt32. Return the width of a column in the grid.
[read-only]
GravityGravityFlags. Describes how the child views are horizontally aligned.
[read-only]
HorizontalSpacingInt32. Returns the amount of horizontal spacing currently used between each item in the grid.
NumColumnsInt32. Get the number of columns in the grid.
[read-only]
RequestedColumnWidthInt32. Return the requested width of a column in the grid.
[read-only]
RequestedHorizontalSpacingInt32. Returns the requested amount of horizontal spacing between each item in the grid.
StretchModeStretchMode.
[read-only]
VerticalSpacingInt32. Returns the amount of vertical spacing between each item in the grid.

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

SetColumnWidth(Int32)
Set the width of columns in the grid.
SetGravity(GravityFlags)
Set the gravity for this grid.
SetHorizontalSpacing(Int32)
Set the amount of horizontal (x) spacing to place between each item in the grid.
SetNumColumns(Int32)
Set the number of columns in the grid
override
SetSelection(Int32)
Sets the currently selected item
SetVerticalSpacing(Int32)
Set the amount of vertical (y) spacing to place between each item in the grid.
SmoothScrollByOffset(Int32)
Smoothly scroll to the specified adapter position offset.