# Toolbar.LayoutParams

Artifact: [androidx.appcompat:appcompat](https://developer.android.com/jetpack/androidx/releases/appcompat) [View Source](https://cs.android.com/search?q=file:androidx/appcompat/widget/Toolbar.java+class:androidx.appcompat.widget.Toolbar.LayoutParams) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

*** ** * ** ***


```
class Toolbar.LayoutParams : ActionBar.LayoutParams
```

<br />

|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||||
| ↳ | [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) ||||
|   | ↳ | [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) |||
|   |   | ↳ | [androidx.appcompat.app.ActionBar.LayoutParams](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.LayoutParams) ||
|   |   |   | ↳ | [androidx.appcompat.widget.Toolbar.LayoutParams](https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams) |

*** ** * ** ***

Layout information for child views of Toolbars.

Toolbar.LayoutParams extends ActionBar.LayoutParams for compatibility with existing ActionBar API. See `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity#setSupportActionBar(androidx.appcompat.widget.Toolbar)` for more info on how to use a Toolbar as your Activity's ActionBar.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(int)(gravity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(androidx.appcompat.app.ActionBar.LayoutParams)(source: https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.LayoutParams!)` |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(androidx.appcompat.widget.Toolbar.LayoutParams)(source: https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams!)` |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(android.view.ViewGroup.LayoutParams)(source: https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(android.view.ViewGroup.MarginLayoutParams)(source: https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(android.content.Context,android.util.AttributeSet)(c: https://developer.android.com/reference/android/content/Context.html, attrs: https://developer.android.com/reference/android/util/AttributeSet.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(int,int)(width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar.LayoutParams#LayoutParams(int,int,int)(width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, gravity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

| ### Inherited Constants |
|---|
| From [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#FILL_PARENT = -1` **This property is deprecated.** | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT = -1` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT = -2` | |

| ### Inherited functions |
|---|
| From [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#setBaseAttributes(android.content.res.TypedArray, int, int)(a: https://developer.android.com/reference/android/content/res/TypedArray.html!, widthAttr: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, heightAttr: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | |
| From [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getLayoutDirection()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getMarginEnd()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getMarginStart()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#isMarginRelative()()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#resolveLayoutDirection(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setLayoutDirection(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMarginEnd(int)(end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMarginStart(int)(start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMargins(int, int, int, int)(left: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, top: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, right: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bottom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | |

| ### Inherited properties |
|---|
| From [androidx.appcompat.app.ActionBar.LayoutParams](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.LayoutParams) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar.LayoutParams#gravity()` Gravity for the view associated with these LayoutParams. | |
| From [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#height` | | `https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters.html!` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#layoutAnimationParameters` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#width` | |
| From [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#bottomMargin` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#leftMargin` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#rightMargin` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#topMargin` | |

## Public constructors

### LayoutParams

```
LayoutParams(gravity: Int)
```

### LayoutParams

```
LayoutParams(source: ActionBar.LayoutParams!)
```

### LayoutParams

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
LayoutParams(source: Toolbar.LayoutParams!)
```

### LayoutParams

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

### LayoutParams

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

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

### LayoutParams

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

### LayoutParams

```
LayoutParams(width: Int, height: Int)
```

### LayoutParams

```
LayoutParams(width: Int, height: Int, gravity: Int)
```