Google is committed to advancing racial equity for Black communities. See how.
Added in API level 1

LayoutParams

open class LayoutParams : LinearLayout.LayoutParams
kotlin.Any
   ↳ android.view.ViewGroup.LayoutParams
   ↳ android.view.ViewGroup.MarginLayoutParams
   ↳ android.widget.LinearLayout.LayoutParams
   ↳ android.widget.TableRow.LayoutParams

Set of layout parameters used in table rows.

Summary

XML attributes

android:layout_column The index of the column in which this child should be.
android:layout_span Defines how many columns this child should span.

Inherited XML attributes

Inherited constants

Public constructors

<init>(c: Context!, attrs: AttributeSet!)

<init>(w: Int, h: Int)

Sets the child width and the child height.

<init>(w: Int, h: Int, initWeight: Float)

Sets the child width, height and weight.

Sets the child width to android.view.ViewGroup.LayoutParams and the child height to android.view.ViewGroup.LayoutParams#WRAP_CONTENT.

<init>(column: Int)

Puts the view in the specified column.

Protected methods

open Unit
setBaseAttributes(a: TypedArray!, widthAttr: Int, heightAttr: Int)

Inherited functions

Properties

Int

The column index of the cell represented by the widget.

Int

The number of columns the widgets spans over.

Inherited properties

XML attributes

android:layout_column

android:layout_column
The index of the column in which this child should be.

May be an integer value, such as "100".

android:layout_span

android:layout_span
Defines how many columns this child should span. Must be >= 1.

May be an integer value, such as "100".

Public constructors

<init>

Added in API level 1
LayoutParams(
    c: Context!,
    attrs: AttributeSet!)

<init>

Added in API level 1
LayoutParams(
    w: Int,
    h: Int)

Sets the child width and the child height.

Parameters
w Int: the desired width
h Int: the desired height

<init>

Added in API level 1
LayoutParams(
    w: Int,
    h: Int,
    initWeight: Float)

Sets the child width, height and weight.

Parameters
w Int: the desired width
h Int: the desired height
initWeight Float: the desired weight

<init>

Added in API level 1
LayoutParams()

Sets the child width to android.view.ViewGroup.LayoutParams and the child height to android.view.ViewGroup.LayoutParams#WRAP_CONTENT.

<init>

Added in API level 1
LayoutParams(column: Int)

Puts the view in the specified column.

Sets the child width to android.view.ViewGroup.LayoutParams#MATCH_PARENT and the child height to android.view.ViewGroup.LayoutParams#WRAP_CONTENT.

Parameters
column Int: the column index for the view

<init>

Added in API level 1
LayoutParams(p: ViewGroup.LayoutParams!)

<init>

Added in API level 1
LayoutParams(source: ViewGroup.MarginLayoutParams!)

Protected methods

setBaseAttributes

Added in API level 1
protected open fun setBaseAttributes(
    a: TypedArray!,
    widthAttr: Int,
    heightAttr: Int
): Unit
Parameters
a TypedArray!: the style attributes to extract the parameters from
widthAttr Int: the identifier of the width attribute
heightAttr Int: the identifier of the height attribute

Properties

column

Added in API level 1
var column: Int

The column index of the cell represented by the widget.

span

Added in API level 1
var span: Int

The number of columns the widgets spans over.