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.TableLayout.LayoutParams

This set of layout parameters enforces the width of each child to be MATCH_PARENT and the height of each child to be WRAP_CONTENT, but only if the height is not specified.

Summary

Inherited XML attributes
Inherited constants
Public constructors

LayoutParams(w: Int, h: Int)

LayoutParams(w: Int, h: Int, initWeight: Float)

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

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

Fixes the row's width to android.view.ViewGroup.LayoutParams#MATCH_PARENT; the row's height is fixed to android.view.ViewGroup.LayoutParams#WRAP_CONTENT if no layout height is specified.

Inherited functions
Inherited properties

Public constructors

LayoutParams

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

LayoutParams

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

LayoutParams

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

LayoutParams

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.

LayoutParams

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

LayoutParams

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

Fixes the row's width to android.view.ViewGroup.LayoutParams#MATCH_PARENT; the row's height is fixed to android.view.ViewGroup.LayoutParams#WRAP_CONTENT if no layout height is specified.

Parameters
a TypedArray!: the styled attributes set
widthAttr Int: the width attribute to fetch
heightAttr Int: the height attribute to fetch