Java android.widget GridView fields, constructors, methods, implement or subclass

Example usage for Java android.widget GridView fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.widget GridView.

The text is from its open source code.

Subclass

android.widget.GridView has subclasses.
Click this link to see all its subclasses.

Field

intNO_STRETCH
Disables stretching.
intSTRETCH_SPACING
Stretches the spacing between columns.
intSTRETCH_COLUMN_WIDTH
Stretches columns.
intSTRETCH_SPACING_UNIFORM
Stretches the spacing between columns.
intAUTO_FIT
Creates as many columns as can fit on screen.

Constructor

Method

ListAdaptergetAdapter()
intgetHorizontalSpacing()
Returns the amount of horizontal spacing currently used between each item in the grid.
intgetNumColumns()
Get the number of columns in the grid.
intgetRequestedColumnWidth()
Return the requested width of a column in the grid.
intgetVerticalSpacing()
Returns the amount of vertical spacing between each item in the grid.
voidinvalidateViews()
Causes all the views to be rebuilt and redrawn.
voidrequestLayout()
voidsetAdapter(ListAdapter adapter)
Sets the data behind this GridView.
voidsetCacheColorHint(@ColorInt int color)
When set to a non-zero value, the cache color hint indicates that this list is always drawn on top of a solid, single-color, opaque background.
voidsetChoiceMode(int choiceMode)
Defines the choice behavior for the List.
voidsetColumnWidth(int columnWidth)
Set the width of columns in the grid.
voidsetDrawSelectorOnTop(boolean onTop)
Controls whether the selection highlight drawable should be drawn on top of the item or behind it.
voidsetFastScrollAlwaysVisible(final boolean alwaysShow)
Set whether or not the fast scroller should always be shown in place of the standard scroll bars.
voidsetFastScrollEnabled(final boolean enabled)
Specifies whether fast scrolling is enabled or disabled.
voidsetGravity(int gravity)
Set the gravity for this grid.
voidsetHorizontalSpacing(int horizontalSpacing)
Set the amount of horizontal (x) spacing to place between each item in the grid.
voidsetItemChecked(int position, boolean value)
Sets the checked state of the specified position.
voidsetNumColumns(int numColumns)
Set the number of columns in the grid
voidsetOnScrollListener(OnScrollListener l)
Set the listener that will receive notifications every time the list scrolls.
voidsetOverScrollMode(int mode)
voidsetSelection(int position)
Sets the currently selected item
voidsetSelectionFromTop(int position, int y)
Sets the selected item and positions the selection y pixels from the top edge of the ListView.
voidsetSelector(@DrawableRes int resID)
Set a Drawable that should be used to highlight the currently selected item.
voidsetSmoothScrollbarEnabled(boolean enabled)
When smooth scrollbar is enabled, the position and size of the scrollbar thumb is computed based on the number of visible pixels in the visible items.
voidsetStretchMode(@StretchMode int stretchMode)
Control how items are stretched to fill their space.
voidsetVelocityScale(float scale)
Sets a scale factor for the fling velocity.
voidsetVerticalSpacing(int verticalSpacing)
Set the amount of vertical (y) spacing to place between each item in the grid.
voidsmoothScrollBy(int distance, int duration)
Smoothly scroll by distance pixels over duration milliseconds.
voidsmoothScrollToPosition(int position)
Smoothly scroll to the specified adapter position.