# RadioGroup.LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# LayoutParams

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/widget/RadioGroup.LayoutParams "View this page in Java")  

```
open class LayoutParams : LinearLayout.LayoutParams
```

|---|---|---|---|----------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                            |||||
| ↳ | [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#)           ||||
|   | ↳ | [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#) |||
|   |   | ↳ | [android.widget.LinearLayout.LayoutParams](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams) ||
|   |   |   | ↳ | [android.widget.RadioGroup.LayoutParams](https://developer.android.com/reference/kotlin/android/widget/RadioGroup.LayoutParams#) |

This set of layout parameters defaults the width and the height of the children to[WRAP_CONTENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT:kotlin.Int)when they are not specified in the XML file. Otherwise, this class ussed the value read from the XML file.

See[LinearLayout Attributes](https://developer.android.com/reference/kotlin/android/R.styleable.html#LinearLayout_Layout:kotlin.IntArray)for a list of all child view attributes that this class supports.

## Summary

| Inherited XML attributes ||
|---|---|
| From class[LayoutParams](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams) |-------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [android:layout_gravity](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams#attr_LayoutParams) | Gravity specifies how a component should be placed in its group of cells. The default is[android.view.Gravity#TOP](https://developer.android.com/reference/kotlin/android/view/Gravity.html#TOP:kotlin.Int). See[android.widget.LinearLayout#setGravity(int)](https://developer.android.com/reference/kotlin/android/widget/LinearLayout#setGravity(kotlin.Int)). Must be one or more (separated by '\|') of the following constant values. |     Constant      | Value  |                                                                                                                                         Description                                                                                                                                         | |-------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | bottom            | 50     | Push object to the bottom of its container, not changing its size.                                                                                                                                                                                                                          | | center            | 11     | Place the object in the center of its container in both the vertical and horizontal axis, not changing its size.                                                                                                                                                                            | | center_horizontal | 1      | Place object in the horizontal center of its container, not changing its size.                                                                                                                                                                                                              | | center_vertical   | 10     | Place object in the vertical center of its container, not changing its size.                                                                                                                                                                                                                | | clip_horizontal   | 8      | Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. The clip will be based on the horizontal gravity: a left gravity will clip the right edge, a right gravity will clip the left edge, and neither will clip both edges. | | clip_vertical     | 80     | Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. The clip will be based on the vertical gravity: a top gravity will clip the bottom edge, a bottom gravity will clip the top edge, and neither will clip both edges.   | | end               | 800005 | Push object to the end of its container, not changing its size.                                                                                                                                                                                                                             | | fill              | 77     | Grow the horizontal and vertical size of the object if needed so it completely fills its container.                                                                                                                                                                                         | | fill_horizontal   | 7      | Grow the horizontal size of the object if needed so it completely fills its container.                                                                                                                                                                                                      | | fill_vertical     | 70     | Grow the vertical size of the object if needed so it completely fills its container.                                                                                                                                                                                                        | | left              | 3      | Push object to the left of its container, not changing its size.                                                                                                                                                                                                                            | | right             | 5      | Push object to the right of its container, not changing its size.                                                                                                                                                                                                                           | | start             | 800003 | Push object to the beginning of its container, not changing its size.                                                                                                                                                                                                                       | | top               | 30     | Push object to the top of its container, not changing its size.                                                                                                                                                                                                                             | <br /> | | [android:layout_weight](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams#attr_LayoutParams)  | Indicates how much of the extra space in the LinearLayout is allocated to the view associated with these LayoutParams. Specify 0 if the view should not be stretched. Otherwise the extra pixels will be pro-rated among all views whose weight is greater than 0. May be a floating point value, such as "`1.2`". <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | ||
| From class[LayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#) |------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [android:layout_height](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#attr_LayoutParams) | Specifies the basic height of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant height or one of the special constants. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). Must be one of the following constant values. |   Constant   |  Value   |                                                                   Description                                                                    | |--------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------| | fill_parent  | ffffffff | The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by`match_parent`. | | match_parent | ffffffff | The view should be as big as its parent (minus padding). Introduced in API Level 8.                                                              | | wrap_content | fffffffe | The view should be only big enough to enclose its content (plus padding).                                                                        | <br /> | | [android:layout_width](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#attr_LayoutParams)  | Specifies the basic width of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant width or one of the special constants. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). Must be one of the following constant values. |   Constant   |  Value   |                                                                   Description                                                                    | |--------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------| | fill_parent  | ffffffff | The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by`match_parent`. | | match_parent | ffffffff | The view should be as big as its parent (minus padding). Introduced in API Level 8.                                                              | | wrap_content | fffffffe | The view should be only big enough to enclose its content (plus padding).                                                                        | <br />   | ||
| From class[MarginLayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#) |----------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [android:layout_margin](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)           | Specifies extra space on the left, top, right and bottom sides of this view. If both layout_margin and any of layout_marginLeft, layout_marginRight, layout_marginStart, layout_marginEnd, layout_marginTop, and layout_marginBottom are also specified, the layout_margin value will take precedence over the edge-specific values. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />                                                                                                                                                                     | | [android:layout_marginBottom](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)     | Specifies extra space on the bottom side of this view. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [android:layout_marginEnd](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)        | Specifies extra space on the end side of this view. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | [android:layout_marginHorizontal](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams) | Specifies extra space on the left and right sides of this view. Specifying layout_marginHorizontal is equivalent to specifying layout_marginLeft and layout_marginRight. If both layout_marginHorizontal and either/both of layout_marginLeft and layout_marginRight are also specified, the layout_marginHorizontal value will take precedence over the edge-specific values. Also, layout_margin will always take precedence over any of these values, including layout_marginHorizontal. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />              | | [android:layout_marginLeft](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)       | Specifies extra space on the left side of this view. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [android:layout_marginRight](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)      | Specifies extra space on the right side of this view. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [android:layout_marginStart](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)      | Specifies extra space on the start side of this view. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [android:layout_marginTop](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)        | Specifies extra space on the top side of this view. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | [android:layout_marginVertical](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#attr_MarginLayoutParams)   | Specifies extra space on the top and bottom sides of this view. Specifying layout_marginVertical is equivalent to specifying layout_marginTop and layout_marginBottom with that same value. If both layout_marginVertical and either/both of layout_marginTop and layout_marginBottom are also specified, the layout_marginVertical value will take precedence over the edge-specific values. Also, layout_margin will always take precedence over any of these values, including layout_marginVertical. This space is outside this view's bounds. Margin values should be positive. May be a dimension value, which is a floating point number appended with a unit such as "`14.5sp`". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). <br /> | ||

| Inherited constants ||
|---|---|
| From class[LayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#) |----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FILL_PARENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#FILL_PARENT:kotlin.Int) <br /> Special value for the height or width requested by a View. FILL_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. This value is deprecated starting in API Level 8 and replaced by[MATCH_PARENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT:kotlin.Int). <br /> | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MATCH_PARENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT:kotlin.Int) <br /> Special value for the height or width requested by a View. MATCH_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. Introduced in API Level 8. <br />                                                                                                                                                                    | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [WRAP_CONTENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT:kotlin.Int) <br /> Special value for the height or width requested by a View. WRAP_CONTENT means that the view wants to be just large enough to fit its own internal content, taking its own padding into account. <br />                                                                                                                                                                 | ||

|                                                                                                                                                                                                              Public constructors                                                                                                                                                                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [LayoutParams](https://developer.android.com/reference/kotlin/android/widget/RadioGroup.LayoutParams#LayoutParams(android.content.Context,%20android.util.AttributeSet))`(`c:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!`, `attrs:` `[AttributeSet](https://developer.android.com/reference/kotlin/android/util/AttributeSet.html#)!`)` <br />                                              |
| [LayoutParams](https://developer.android.com/reference/kotlin/android/widget/RadioGroup.LayoutParams#LayoutParams(android.view.ViewGroup.LayoutParams))`(`p:` `[ViewGroup.LayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#)!`)` <br />                                                                                                                                                |
| [LayoutParams](https://developer.android.com/reference/kotlin/android/widget/RadioGroup.LayoutParams#LayoutParams(android.view.ViewGroup.MarginLayoutParams))`(`source:` `[ViewGroup.MarginLayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#)!`)` <br />                                                                                                                         |
| [LayoutParams](https://developer.android.com/reference/kotlin/android/widget/RadioGroup.LayoutParams#LayoutParams(kotlin.Int,%20kotlin.Int))`(`w:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `h:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                                 |
| [LayoutParams](https://developer.android.com/reference/kotlin/android/widget/RadioGroup.LayoutParams#LayoutParams(kotlin.Int,%20kotlin.Int,%20kotlin.Float))`(`w:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `h:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `initWeight:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Protected methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setBaseAttributes](https://developer.android.com/reference/kotlin/android/widget/RadioGroup.LayoutParams#setBaseAttributes(android.content.res.TypedArray,%20kotlin.Int,%20kotlin.Int))`(`a:` `[TypedArray](https://developer.android.com/reference/kotlin/android/content/res/TypedArray.html#)!`, `widthAttr:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `heightAttr:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Fixes the child's width to[android.view.ViewGroup.LayoutParams#WRAP_CONTENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT:kotlin.Int)and the child's height to[android.view.ViewGroup.LayoutParams#WRAP_CONTENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT:kotlin.Int)when not specified in the XML file. |

| Inherited functions ||
|---|---|
| From class[LayoutParams](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams) |-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [debug](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams#debug(kotlin.String))`(`output:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> | ||
| From class[MarginLayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#) |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [getLayoutDirection](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#getLayoutDirection())`()` <br /> Retuns the layout direction. Can be either[View.LAYOUT_DIRECTION_LTR](https://developer.android.com/reference/kotlin/android/view/View.html#LAYOUT_DIRECTION_LTR:kotlin.Int)or[View.LAYOUT_DIRECTION_RTL](https://developer.android.com/reference/kotlin/android/view/View.html#LAYOUT_DIRECTION_RTL:kotlin.Int). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [getMarginEnd](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#getMarginEnd())`()` <br /> Returns the end margin in pixels. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [getMarginStart](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#getMarginStart())`()` <br /> Returns the start margin in pixels. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isMarginRelative](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#isMarginRelative())`()` <br /> Check if margins are relative. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [resolveLayoutDirection](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#resolveLayoutDirection(kotlin.Int))`(`layoutDirection:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> This will be called by[android.view.View#requestLayout()](https://developer.android.com/reference/kotlin/android/view/View.html#requestLayout()). Left and Right margins may be overridden depending on layout direction. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [setLayoutDirection](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#setLayoutDirection(kotlin.Int))`(`layoutDirection:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Set the layout direction <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [setMarginEnd](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#setMarginEnd(kotlin.Int))`(`end:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the relative end margin. Margin values should be positive. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [setMarginStart](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#setMarginStart(kotlin.Int))`(`start:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the relative start margin. Margin values should be positive. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [setMargins](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#setMargins(kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`left:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `top:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `right:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `bottom:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the margins, in pixels. A call to[android.view.View#requestLayout()](https://developer.android.com/reference/kotlin/android/view/View.html#requestLayout())needs to be done so that the new margins are taken into account. Left and right margins may be overridden by[android.view.View#requestLayout()](https://developer.android.com/reference/kotlin/android/view/View.html#requestLayout())depending on layout direction. Margin values should be positive. <br /> | ||
| From class[LayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#) |------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setBaseAttributes](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#setBaseAttributes(android.content.res.TypedArray,%20kotlin.Int,%20kotlin.Int))`(`a:` `[TypedArray](https://developer.android.com/reference/kotlin/android/content/res/TypedArray.html#)!`, `widthAttr:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `heightAttr:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Extracts the layout parameters from the supplied attributes. <br /> | ||

| Inherited properties ||
|---|---|
| From class[MarginLayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#) |----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [bottomMargin](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#bottomMargin:kotlin.Int) <br /> The bottom margin in pixels of the child. Margin values should be positive. Call[ViewGroup.setLayoutParams(LayoutParams)](https://developer.android.com/reference/kotlin/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams))after reassigning a new value to this field. <br /> | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [leftMargin](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#leftMargin:kotlin.Int) <br /> The left margin in pixels of the child. Margin values should be positive. Call[ViewGroup.setLayoutParams(LayoutParams)](https://developer.android.com/reference/kotlin/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams))after reassigning a new value to this field. <br />       | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [rightMargin](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#rightMargin:kotlin.Int) <br /> The right margin in pixels of the child. Margin values should be positive. Call[ViewGroup.setLayoutParams(LayoutParams)](https://developer.android.com/reference/kotlin/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams))after reassigning a new value to this field. <br />    | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [topMargin](https://developer.android.com/reference/kotlin/android/view/ViewGroup.MarginLayoutParams.html#topMargin:kotlin.Int) <br /> The top margin in pixels of the child. Margin values should be positive. Call[ViewGroup.setLayoutParams(LayoutParams)](https://developer.android.com/reference/kotlin/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams))after reassigning a new value to this field. <br />          | ||
| From class[LayoutParams](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams) |--------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)     | [gravity](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams#gravity:kotlin.Int) <br /> Gravity for the view associated with these LayoutParams. <br />                                                                                                                                                                                                                | | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | [weight](https://developer.android.com/reference/kotlin/android/widget/LinearLayout.LayoutParams#weight:kotlin.Float) <br /> Indicates how much of the extra space in the LinearLayout will be allocated to the view associated with these LayoutParams. Specify 0 if the view should not be stretched. Otherwise the extra pixels will be pro-rated among all views whose weight is greater than 0. <br /> | ||
| From class[LayoutParams](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#) |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                  | [height](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#height:kotlin.Int) <br /> Information about how tall the view wants to be. Can be one of the constants FILL_PARENT (replaced by MATCH_PARENT in API Level 8) or WRAP_CONTENT, or an exact size. <br /> | | [LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/kotlin/android/view/animation/LayoutAnimationController.AnimationParameters.html#)! | [layoutAnimationParameters](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#layoutAnimationParameters:android.view.animation.LayoutAnimationController.AnimationParameters) <br /> Used to animate layouts. <br />                                              | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                  | [width](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#width:kotlin.Int) <br /> Information about how wide the view wants to be. Can be one of the constants FILL_PARENT (replaced by MATCH_PARENT in API Level 8) or WRAP_CONTENT, or an exact size. <br />   | ||

## Public constructors

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
LayoutParams(
    c: Context!, 
    attrs: AttributeSet!)
```  

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
LayoutParams(p: ViewGroup.LayoutParams!)
```  

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
LayoutParams(source: ViewGroup.MarginLayoutParams!)
```  

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
LayoutParams(
    w: Int, 
    h: Int)
```  

### LayoutParams

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

## Protected methods

### setBaseAttributes

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

Fixes the child's width to[android.view.ViewGroup.LayoutParams#WRAP_CONTENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT:kotlin.Int)and the child's height to[android.view.ViewGroup.LayoutParams#WRAP_CONTENT](https://developer.android.com/reference/kotlin/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT:kotlin.Int)when not specified in the XML file.

|                                                                 Parameters                                                                 ||
|--------------|------------------------------------------------------------------------------------------------------------------------------|
| `a`          | [TypedArray](https://developer.android.com/reference/kotlin/android/content/res/TypedArray.html#)!:the styled attributes set |
| `widthAttr`  | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the width attribute to fetch                      |
| `heightAttr` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the height attribute to fetch                     |